Question: Tasks/Assignments(s) 1. Create SinglyLinkedList for students (id, name). Apply all the following operations as discussed in the lecture: addFirst: to add new node to the
Tasks/Assignments(s) 1. Create SinglyLinkedList for students (id, name). Apply all the following operations as discussed in the lecture: addFirst: to add new node to the beginning of the linked list. addLast: to add new node to the end of the linked list. addNode to add new node to a specific position in the linked list. removeFirst: to remove the first node in the linked list. findNode: to find a node with specific given value. removeNode: to remove a specific node from the list. addAfter which takes two parameters (Node v, int key). Node v will be added after the node with an id=key. If the key wasn't found display ("error, no node has the given id"). displayList: to print all Nodes data. First: to print first node data. Last: to print last node data
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
