File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
com/williamfiset/algorithms/datastructures/linkedlist Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ public class DoublyLinkedList<T> implements Iterable<T> {
11
11
private Node <T > tail = null ;
12
12
13
13
// Internal node class to represent data
14
- private class Node <T > {
15
- T data ;
16
- Node <T > prev , next ;
14
+ private static class Node <T > {
15
+ private T data ;
16
+ private Node <T > prev , next ;
17
17
18
18
public Node (T data , Node <T > prev , Node <T > next ) {
19
19
this .data = data ;
@@ -157,9 +157,10 @@ private T remove(Node<T> node) {
157
157
158
158
// Remove a node at a particular index, O(n)
159
159
public T removeAt (int index ) {
160
-
161
160
// Make sure the index provided is valid
162
- if (index < 0 || index >= size ) throw new IllegalArgumentException ();
161
+ if (index < 0 || index >= size ) {
162
+ throw new IllegalArgumentException ();
163
+ }
163
164
164
165
int i ;
165
166
Node <T > trav ;
You can’t perform that action at this time.
0 commit comments