/DSALGO

Javascript Algorithms

Primary LanguageJavaScript

Stacks - LIFO

Advantages

  • Managing function invocations
  • Undo/Redo
  • Routing(the history object) is treated like object.

Big O

  • Inserstion O(1) -> using unshift method
  • Removal O(1) -> using shift method
  • Searching/Acess O(N)

Queues - FIFO

Advantages

  • Online game joining. Ex:- PUBG!!
  • Background tasks.
  • Uploading resources.
  • Printing.

Big O

  • Inserstion O(1)
  • Removal O(1)
  • Searching/Acess O(N)