I'm trying to understand if there is a difference in speed when executing the following lines of code in a computer program:

- myarray[1] = 5; return myarray[1];
- myarray[0] = 5; return myarray[0];
- x = 5; return x;
- x = 5; y = x; return y;
- return 5;

From what I understand, arrays are basically pointers (variables that store the memory addresses of other variables). Therefore (1) and (2) should be the same speed, but slower than (3), (4) and (5).

(5) should be the fastest, (3) should be slower than (5) because there is an equal sign, and (4) should be slower than (3) because there are two equal signs that need to be handled.

Would this be right?