Question:medium

The worst-case time complexity of inserting a node in a doubly linked list is:

Show Hint

Doubly linked lists allow constant-time insertion when the node reference is provided, unlike arrays that require shifting.
Updated On: Feb 11, 2026
  • O(n log n)
  • O(log n)
  • O(n)
  • O(1)
Show Solution

The Correct Option is D

Solution and Explanation

In a doubly linked list, insertion at a known position is an O(1) operation, as it directly updates the previous and next node pointers. While locating the insertion point may necessitate traversal if not directly known, the insertion operation itself consistently maintains an O(1) time complexity.
Was this answer helpful?
0