79743812

Date: 2025-08-22 20:15:24
Score: 1.5
Natty:
Report link

You are probably thinking memory blocks as similar boxes kept side by side, and to look up 209th box, you may need to count the boxes as you go.

But think of it this way, suppose there are 1024 boxes, and each has a number written on the side facing you. Also, they are arranged around you in a circle in a clockwise order. Now, if you are instructed to get the value in the 209th box, what do you do? You exactly know where the 209th box is (at 209/1024*360 degrees clockwise). You turn by that exact amount, see the box, and fetch the value.

Calculating the degrees to turn is a constant time operation.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: jetshaun