Returns the head's value of the list if the list is not empty or returns undefined
const list = new SinglyLinkedList<number>();list.insertAtEnd(1);list.insertAtEnd(2);console.log(list.head); // 1list.deleteFromStart();console.log(list.head); // 2
Returns the length of the list
const list = new SinglyLinkedList<number>();list.insertAtEnd(1);list.insertAtEnd(2);list.insertAtEnd(3);console.log(list.length); // 3list.deleteFromEnd();console.log(list.length); // 2
Returns the tail's value of the list if the list is not empty or returns undefined
const list = new SinglyLinkedList<number>();list.insertAtEnd(1);list.insertAtEnd(2);console.log(list.tail); // 2list.deleteFromEnd();console.log(list.tail); // 1
Generated using TypeDoc, the 1/4/2022 at 10:37:56 PM
Returns the head's value of the list if the list is not empty or returns undefined