JavaScript | Linked List | Question 5

Last Updated :
Discuss
Comments

In a linked list, what is the time complexity for inserting a new node at the beginning?

O(1)

O(n)

O(log n)

O(n^2)

Share your thoughts in the comments