Problemas
Which of the following data structures can erase from its beginning or its end in O(1) time? O(1) Pick ONE option vector deque stack segment tree
Roztwór
Miguel
experto · Tutor durante 3 años
4.6
(234 Votos)
Respuesta
dequeExplanation: A deque (double-ended queue) is a data structure that allows insertion and deletion of elements from both ends in O(1) time. Therefore, it can erase elements from its beginning or end in O(1) time.