Make allows the creation of a stack with an initial capacity for efficiency. Otherwise a stack can be used in its zero value state.
(cap int)
| 20 | // capacity for efficiency. Otherwise a stack can be |
| 21 | // used in its zero value state. |
| 22 | func Make(cap int) *Stack { |
| 23 | return &Stack{ |
| 24 | data: make([]*Data, 0, cap), |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | // Count returns the number of items in the stack. |
| 29 | func (s *Stack) Count() int { |