Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 908 Bytes

class401-10.md

File metadata and controls

26 lines (21 loc) · 908 Bytes

Stacks and Queues

Both are data structures that add data and remove it

Stacks

  • Stack is LIFO - dirty dishes stacked, you remove the last one added
  • Abstract data collection (more than one way to build this)
  • Uses:
    • undo/redo functionality in most software
    • manageing function invocations
    • routing (browser history)
    • tree and graph algorithms

Queues

  • Queue is FIFO - like a line for a ride, first person in line, is first on the ride (out)
  • Abstract data collection as well (more than one way to build this)
  • Uses:
    • videogame queues
    • background tasks
    • uploading resources
    • printing/task processing (first document sent will be first to print)

Resources

  • source
  • JavaScript Algorithms and Data Structures Masterclass (udemy)