(left, right int)
| 161 | return nil |
| 162 | } |
| 163 | func (ll *Singly[T]) CheckRangeFromIndex(left, right int) error { |
| 164 | if left > right { |
| 165 | return errors.New("left boundary must smaller than right") |
| 166 | } else if left < 1 { |
| 167 | return errors.New("left boundary starts from the first node") |
| 168 | } else if right > ll.length { |
| 169 | return errors.New("right boundary cannot be greater than the length of the linked list") |
| 170 | } |
| 171 | return nil |
| 172 | } |
| 173 | |
| 174 | // Display prints out the elements of the list. |
| 175 | func (ll *Singly[T]) Display() { |