[prev] 86 [next]

Example: Abstract Stack Data Object

Stack, aka pushdown stack or LIFO data structure (last in, first out)

Assume (for the time being) stacks of char values

Operations:

  • create an empty stack
  • insert (push) an item onto stack
  • remove (pop) most recently pushed item
  • check whether stack is empty
Applications:
  • undo sequence in a text editor
  • bracket matching algorithm