Question: Write the following member methods, and add the appropriate code in the main application to invoke them: a. count(): returns the number of nodes


Write the following member methods, and add the appropriate code in the main application to invoke them: a. count(): returns the number of nodes in the linked list b. display PreSucc(T val): displays the data values of the predecessor and successor nodes of val in the list public class SingleLinkedListApplication { public static void main(String[] args) { SingleLinkedList sll new SingleLinkedList(); sll.insertFirst(15); sll.displayList(); sll. insertFirst(25); sll.displayList(); sl1.insertLast (35); sll.displayList(); sl1.insertLast (45); sll.displayList(); sll.displayList(); sll.displayList(); sll.displayList(); s11.insertFirst(75); sll.displayList(); sll.deleteFirst(); sll.displayList(); s11.deleteLast(); sll.displayList(); sll.deleteAfterNode(55); sll.displayList(); s11.deleteAfterNode(25); sll.displayList();
Step by Step Solution
3.36 Rating (149 Votes )
There are 3 Steps involved in it
It looks like youre trying to create and manipulate a singly linked list in Java H... View full answer
Get step-by-step solutions from verified subject matter experts
