Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the worst case time complexity of inserting a node in a doubly linked list?

a) O(nlogn)
b) O(logn)
c) O(n)
d) O(1)

Answer: c
Explanation: In the worst case, the position to be inserted maybe at the end of the list, hence you have to traverse through the entire list to get to the correct position, hence O(n).

Join The Discussion