Accessing the nth element of a singly linked list takes time:
2025
Accessing the nth element of a singly linked list takes time:
- A.
O(1)
- B.
O(log n)
- C.
O(n)
- D.
O(n^2)
Attempted by 127 students.
Show answer & explanation
Correct answer: C
A singly linked list must be traversed node by node to reach the nth element, so access takes O(n) time.