What is the worst-case time complexity of inserting an element at the beginning of an array containing N elements?
Options
- A. O(1)
- B. O(log n)
- C. O(n)
- D. More than one of the above
- E. None of the above
Quiz Practice:
C. O(n)
Correct Answer: C. O(n)
Explanation: Inserting an element at the beginning of an array generally requires shifting existing elements one position to the right.