Browse Source

docs: adding more details about the edge case out of bound

pull/2648/head v24.15.0-2024.07.16
amin 2 months ago committed by zanninso
parent
commit
d98cd96e99
  1. 2
      subjects/java/checkpoints/double-linkedlist/README.md

2
subjects/java/checkpoints/double-linkedlist/README.md

@ -6,7 +6,7 @@ Create a double linked list data structure that implements the following methods
- `at(int index)`: to access an element by its index. If the index is out of bound return -1.
- `add(int value)`: to add an element at the end of the list.
- `remove(int index)`: to remove an element by its index.
- `remove(int index)`: to remove an element by its index. If the index is out of bound nothing happen.
- `size()`: to get the size of the list.
Define these methods in an interface called `LinkedList`, and implement this interface in a class that you will create. Additionally, add private methods `next(Node node)` and `prev(Node node)` in your class that will be used in the other methods. These methods should print the messages "Go to next node\n" and "Go to previous node\n" each time they are called, respectively.

Loading…
Cancel
Save