Pushes a given item into Stack
(item interface{})
| 21 | |
| 22 | // Pushes a given item into Stack |
| 23 | func (stack *Stack) Push(item interface{}) { |
| 24 | stack.sp = &StackItem{item: item, next: stack.sp} |
| 25 | stack.depth++ |
| 26 | } |
| 27 | |
| 28 | // Deletes top of a stack and return it |
| 29 | func (stack *Stack) Pop() interface{} { |