0

Deq

What is deq? As far as I know, it's like a list array, but they say it's like a queue. What is deq?

2nd Jan 2025, 7:28 PM
Колоб Масло
Колоб Масло - avatar
2 Antworten
+ 2
Колоб Масло this is not quite the right place to raise your question. > *q&a* section is meant for coding related questions, doubts and discussions about the topic. > anything else should be posted in the `feed` that is located in the community section.
2nd Jan 2025, 9:14 PM
Lothar
Lothar - avatar
+ 1
A deque (pronounced “deck”) stands for double ended queue. It functions like a deck of cards, where you can add / remove elements to both the beginning and the end of the list with the same speed as appending an element to the end of a normal array. One disadvantage is that it is not indexed, meaning you must scan through the deque to find an element. This is unlike an array where you can directly access an element at position 3 by doing A[2] (remember arrays start counting from 0).
5th Jan 2025, 6:48 PM
lumpychum