What is the worst-case time complexity of insertion in a singly linked list ?
2025
What is the worst-case time complexity of insertion in a singly linked list ?
- A.
O(1)
- B.
O(log n)
- C.
O(n)
- D.
O(n2)
Attempted by 144 students.
Show answer & explanation
Correct answer: C
Insertion in a singly linked list requires traversing the list to find the correct position. In the worst case, this involves visiting all n nodes, leading to O(n) time complexity.