.. include:: global.rst .. _Overview: *************************** Stack *************************** Code for Stack Clone ======================= .. literalinclude:: ./cpp/stack.cpp Journaling ==================== The stack seems to work similarly to a linked list, but you can only access the most recently added element. You can either add an element to the top of the stack by using the push() method, or remove the top element from the stack by using the pop() method. This is called a "Last in First out" method and it can be useful for undo/redo systems as it allows the computer to store data in a set order while only needing to use the most recent data.