Skip to content

Commit bdcc203

Browse files
authored
Update SinglyLinkedList.java
1 parent 619c40a commit bdcc203

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/main/java/com/thealgorithms/datastructures/lists/SinglyLinkedList.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -396,15 +396,6 @@ public void checkBounds(int position, int low, int high) {
396396
}
397397
}
398398

399-
public int poll(){
400-
if(head==null){
401-
return -1;
402-
}
403-
int headValue=head.value;
404-
head=head.next;
405-
return headValue;
406-
}
407-
408399
/**
409400
* Driver Code
410401
*/
@@ -435,8 +426,7 @@ public static void main(String[] arg) {
435426
assert list.toString().equals("7->3");
436427
System.out.println(list);
437428
assert list.size == 2 && list.size() == list.count();
438-
/* Test poll function */
439-
System.out.println("pop element from head "+list.poll());
429+
440430
list.clear();
441431
assert list.isEmpty();
442432

0 commit comments

Comments
 (0)