Skip to content

Commit

Permalink
docs: adding more details about the edge case out of bound
Browse files Browse the repository at this point in the history
  • Loading branch information
amin authored and zanninso committed Jul 16, 2024
1 parent 7fbf870 commit d98cd96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subjects/java/checkpoints/double-linkedlist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d98cd96

Please sign in to comment.