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

Last Updated :
Discuss
Comments

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

O(1)


O(n)

O(log n)

O(n log n)

Share your thoughts in the comments