Skip to content

Commit 0c4e37d

Browse files
committed
formatting
1 parent 1b20f5a commit 0c4e37d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

com/williamfiset/algorithms/datastructures/linkedlist/DoublyLinkedList.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public class DoublyLinkedList<T> implements Iterable<T> {
1111
private Node<T> tail = null;
1212

1313
// 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;
1717

1818
public Node(T data, Node<T> prev, Node<T> next) {
1919
this.data = data;
@@ -157,9 +157,10 @@ private T remove(Node<T> node) {
157157

158158
// Remove a node at a particular index, O(n)
159159
public T removeAt(int index) {
160-
161160
// 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+
}
163164

164165
int i;
165166
Node<T> trav;

0 commit comments

Comments
 (0)