9.5 Write a method of SinglyLinkedList, called reverse, that reverses the order of the elements in the list. This method should be destructive—it should modify the list upon which it acts. 9.6 Write a method of DoublyLinkedList, called reverse, that reverses the order of the elements in the list. This method should be destructive. 9.7 Write a method of CircularList, called reverse, that reverses the order of the element in the list. This method should be destructive.
9.5 Write a method of SinglyLinkedList, called reverse, that reverses the
order of the elements in the list. This method should be destructive—it should
modify the list upon which it acts.
9.6 Write a method of DoublyLinkedList, called reverse, that reverses the
order of the elements in the list. This method should be destructive.
9.7 Write a method of CircularList, called reverse, that reverses the
order of the element in the list. This method should be destructive.
9.8 Each of the n references in a singly linked list are needed if we wish
to remove the final element. In a doubly linked list, are each of the additional n previous references necessary if we want to remove the tail of the
list in constant time? (Hint: What would happen if we mixed Nodes and
DoublyLinkedNodes?)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 6 images