What is the time complexity of inserting an element at the beginning of a LinkedList?

Last Updated :
Discuss
Comments

What is the time complexity of inserting an element at the beginning of a LinkedList?

O(1)

O(n)


O(log n)


O(n²)


Share your thoughts in the comments