Pagina de 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 segment tree

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

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

Solución

avatar
Miguelexperto · Tutor durante 3 años
expert verifiedVerificación de expertos
4.6 (234 votos)

Responder

deque<br /><br />Explanation: 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.
Haz clic para calificar: