random access

Reaching any element of a sequence directly by its position, in the same time whatever the position.

In more detail

Arrays and Python lists offer O(1) random access because the position translates straight into a memory address. Linked lists and deques do not: reaching the middle means walking through the elements or blocks before it. If your code indexes into the middle often, choose a contiguous structure.

Related terms

Taught in

References