summaryrefslogtreecommitdiff
path: root/mindmap/stack.org
blob: c66e3fa9a2938dac8f9a239be53f5b162ff46c85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
:PROPERTIES:
:ID:       52d255d2-114c-42f4-b362-f0b4a2f7b83d
:END:
#+title: stack
#+author: Preston Pan

* Introduction
A stack in programming is a data structure that satisfies the following API rules:
1. Push: puts something on the top of the stack
2. Pop: takes item off stack and gives it to the caller
3. Peek: hands copy of top item on the stack to caller
4. isEmpty: checks if the stack size is zero
where stacks generally store their data in a list, either an array or a singly linked list.