Stack

  • Think of it as a stack of plates, cards, ...

  • It has 2 principles

    • LIFO: Last in, First out --> The element that was added last, is processed first

    • FIFO: First in, First out --> The element that was added first, is processed first

  • Done through the operations POP and PUSH

  • Implementation is done through an array, pointer or linked list

    • It adds the elements after each other as soon as they appear

Operations

  • Insert

  • Deletion

  • isEmpty

  • top or peek

https://www.tutorialspoint.com/data\_structures\_algorithms/stack\_algorithm.htm

Last updated

Was this helpful?