mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-20 02:04:47 +08:00
Formatted with Google Java Formatter
This commit is contained in:
@ -61,12 +61,12 @@ public class SinglyLinkedList {
|
||||
checkBounds(position, 0, size);
|
||||
Node newNode = new Node(data);
|
||||
if (head == null) {
|
||||
/* the list is empty */
|
||||
/* the list is empty */
|
||||
head = newNode;
|
||||
size++;
|
||||
return;
|
||||
} else if (position == 0) {
|
||||
/* insert at the head of the list */
|
||||
/* insert at the head of the list */
|
||||
newNode.next = head;
|
||||
head = newNode;
|
||||
size++;
|
||||
|
Reference in New Issue
Block a user