Skip to content

Commit

Permalink
LinkedList add a throw
Browse files Browse the repository at this point in the history
  • Loading branch information
Ven13 committed Feb 27, 2017
1 parent 71b3352 commit ed776ab
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public Object get(int index) {

@Override
public Object remove(int index) {
if(size == 0) {
throw new java.util.NoSuchElementException();
}
if(index == 0) {
Node node = head;
Node temp = node.next;
Expand Down

0 comments on commit ed776ab

Please sign in to comment.