What is the time complexity of inserting at the end in dynamic arrays?

Q & ACategory: Data StructureWhat is the time complexity of inserting at the end in dynamic arrays?
Admin Staff asked 5 years ago

What is the time complexity of inserting at the end in dynamic arrays?
a) O(1)
b) O(n)
c) O(logn)
d) Either O(1) or O(n)

1 Answers
Admin Staff answered 5 years ago

d) Either O(1) or O(n)