Question discussion

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

359284Medium DSSSB TGT Computer Science 0 replies 0 views
0
Calculate the time complexity of deleting an element from the beginning of a dynamic array.
  • AO(log)
  • BO(1)
  • CO(log n)
  • DO(n)
Correct answer: D

Explanation

Deleting from the beginning of a dynamic array shifts all the remaining elements by one position, which takes O(n) time.

Discussion 0

Nobody has replied yet. Start the discussion!