Multiple choice technology

If I have a linked list and a array, find the ratio of time complexity to find the index value in the array to the linked list (i.e. complexity to find index value in array / complexity to find index value in linked list)

  1. n:1

  2. n:logn

  3. 1:n

  4. 1:logn

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Accessing an element by index in an array takes O(1) time because arrays use direct memory addressing. In a linked list, finding an element at a specific index requires traversing from the head node, which takes O(n) time in the worst case. The ratio of array access time to linked list access time is therefore 1:n.