What would be the asymptotic time complexity to insert an element at the second position in the linked list?

Q & ACategory: Data StructureWhat would be the asymptotic time complexity to insert an element at the second position in the linked list?
Admin Staff asked 4 years ago

What would be the asymptotic time complexity to insert an element at the second position in the linked list?
a) O(1)
b) O(n)
c) O(n2)
d) O(n3)

1 Answers
Admin Staff answered 4 years ago

a) O(1)