Inicio
/
Tecnología
/
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

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
Weryfikacja ekspertów
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.