What is the worst case time complexity of inserting a node in a doubly linked list?
Open in App
Solution
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).