(index int)
| 39 | return e |
| 40 | } |
| 41 | func (s *Stack) RemoveAt(index int) bool { |
| 42 | if index > s.Size()-1 || index < 0 { |
| 43 | return false |
| 44 | } |
| 45 | if index < s.Size()-1 { |
| 46 | s.array = append(s.array[:index], s.array[index+1:]...) |
| 47 | } else { |
| 48 | s.array = s.array[:index] |
| 49 | } |
| 50 | return true |
| 51 | } |
| 52 | |
| 53 | func (s *Stack) Erase(begin int, end int) bool { |
| 54 | size := s.Size() |