In algorithms, for implementing a queue, instead of using a single linked list (which is slow on dequeue), a more effecient implementation (when enque and deques happen at the same rate) is using [...] (<-- could be more than one word:))
Answer
two stacks
^^ by adding all incoming items to an Insert stack, and removing from the Remove stack (if remove stack is empty, add all
items from insert stack to it one at a time, which preserves the queue order).
Question
In algorithms, for implementing a queue, instead of using a single linked list (which is slow on dequeue), a more effecient implementation (when enque and deques happen at the same rate) is using [...] (<-- could be more than one word:))
Answer
?
Question
In algorithms, for implementing a queue, instead of using a single linked list (which is slow on dequeue), a more effecient implementation (when enque and deques happen at the same rate) is using [...] (<-- could be more than one word:))
Answer
two stacks
^^ by adding all incoming items to an Insert stack, and removing from the Remove stack (if remove stack is empty, add all
items from insert stack to it one at a time, which preserves the queue order).
If you want to change selection, open document below and click on "Move attachment"
pdf
owner: kkhosravi - (no access) - PYTHON_DATA_STRUCTURES_AND_ALGORITHMS.pdf, p136
Summary
status
not learned
measured difficulty
37% [default]
last interval [days]
repetition number in this series
0
memorised on
scheduled repetition
scheduled repetition interval
last repetition or drill
Details
No repetitions
Discussion
Do you want to join discussion? Click here to log in or create user.