()
| 29 | |
| 30 | } |
| 31 | func (s *Stack) Pop() interface{} { |
| 32 | stackLen := len(s.array) |
| 33 | if stackLen == 0 { |
| 34 | return nil |
| 35 | } |
| 36 | e := s.array[stackLen-1] |
| 37 | s.array = s.array[:stackLen-1] |
| 38 | |
| 39 | return e |
| 40 | } |
| 41 | func (s *Stack) RemoveAt(index int) bool { |
| 42 | if index > s.Size()-1 || index < 0 { |
| 43 | return false |
no outgoing calls