Commit eaa4e665 authored by Adam Blank's avatar Adam Blank
Browse files

Update LinkedList.java

parent 152e3895
No related merge requests found
Showing with 0 additions and 10 deletions
+0 -10
......@@ -52,21 +52,11 @@ public class LinkedList<E> implements IList<E> {
this.head = new Node<>(elem);
}
else {
// Write only the else in C16
// I AM ABOUT TO WRITE CODE THAT DOESN'T WORK
// BEWARE!!
/*
Node<E> curr = this.head;
while (curr.next != null) {
curr = curr.next;
}
curr.next = new Node<>(elem);
*/
Node<E> curr;
for (curr = this.head; curr.next != null; curr = curr.next) {
}
}
this.size++;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment