Data Structures Flashcards
1
Q
How would you examine items below the top of a stack?
A
.
2
Q
How would you find out how many items are in a stack?
A
.
3
Q
What happens to the order of values that are moved from one stack to another?
A
they’re flipped
4
Q
How can a stack be returned to its original state after examining its internal values?
A
flip the inverted stack into it
5
Q
How would you examine items after the front of a queue?
A
by removing (temporary) front value and use peek on the next.
6
Q
How would you cycle through items in a queue without permanently removing them?
A
by adding them to another queue