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. (40 points) Consider a variation of the singly linked list that always has a "dummy node" at the Question I. (40 points) Consider a variation of the singly linked list that always has a "dummy node" at the
beginning of the list with no data (i.e. the info field is always null). An empty list contains the dummy node
only. A list with n elements has n+1 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 object/value, 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 (i.e. the info field is always null). An empty list contains the dummy node
only. A list with n elements has n+1 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 object/value, 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.
Question I. ( 4 0 points ) Consider a variation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!