Question: Question I. ( 4 0 points ) Consider a variation of the singly linked list that always has a dummy node at the Question I.
Question I. points Consider a variation of the singly linked list that always has a "dummy node" at the Question I. points Consider a variation of the singly linked list that always has a "dummy node" at the
beginning of the list with no data ie the info field is always null An empty list contains the dummy node
only. A list with n elements has nodes, the first node is the dummy node.
a Rewrite the constructor for SinglyLinkedList so that it creates an "empty" list consisting of the one
dummy node.
b Rewrite the methods addToHead addToTail deleteFromHead deleteFromTail search and
isEmpty Note that the search method returns a reference to the first singly linked list node that
contains the seeked info objectvalue or NULL if the seeked info is not in the linked list.
c Implement a new method reverse that reverses the nodes on the singly linked list.
beginning of the list with no data ie the info field is always null An empty list contains the dummy node
only. A list with n elements has n nodes, the first node is the dummy node.
a Rewrite the constructor for SinglyLinkedList so that it creates an "empty" list consisting of the one
dummy node.
b Rewrite the methods addToHead addToTail deleteFromHead deleteFromTail search and
isEmpty Note that the search method returns a reference to the first singly linked list node that
contains the seeked info objectvalue or NULL if the seeked info is not in the linked list.
c Implement a new method reverse that reverses the nodes on the singly linked list.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
