Please enable JavaScript.
Coggle requires JavaScript to display documents.
Stacks and Queues Overview - Coggle Diagram
Stacks and Queues Overview
Stacks
First in Last Out (FILO) data structure
Items can be added to the top of the stack and only removed from the top
A pointer variable holds the index of the top element
Used for...
Undo and redo in programs
Backtracking algorithms
String reversal
Queues
First in First Out (FIFO) data structure
Items added to the rear and removed from the front
Pointer variables hold the index of the front and rear index
Priority queues adds values at different priority levels in a queue
Used for...
Task scheduling
Resource allocation
Printing queues
Priority queues can be used in shortest route algorithms such as Dijkstra's algorithm
A circular queue prevents a queue reaching the end by allowing pointers to wrap around