Question 80Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

Calculate the time complexity of deleting an element from the beginning of a dynamic array.

  1. AO(log)
  2. BO(1)
  3. CO(log n)
  4. DO(n)
Show answerHide answer

Correct answer: (D) O(n)

Explanation

Removing the first element of a dynamic array requires shifting the remaining n - 1 elements one place left, so it takes O(n) time.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

This is question 80 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.