(i int, value interface{})
| 85 | } |
| 86 | |
| 87 | func (s *Stack) SetTop(i int, value interface{}) bool { |
| 88 | stackLen := s.Size() |
| 89 | if stackLen+i > stackLen-1 || stackLen+i < 0 { |
| 90 | return false |
| 91 | } |
| 92 | s.array[stackLen+i] = value |
| 93 | return true |
| 94 | } |
| 95 | |
| 96 | func (s *Stack) CountBool(val bool) int { |
| 97 | var count int |