Our linked-list class allowed insertions and deletions at only the front and the back of the linked

Question:

Our linked-list class allowed insertions and deletions at only the front and the back of the linked list. These capabilities were convenient for us when we used composition to produce a stack class and a queue class with minimal code simply by reusing the list class. Linked lists are normally more general than those we provided. Modify the linked-list class we developed in this chapter to handle insertions and deletions anywhere in the list. Create diagrams comparable to Figs. 21.5 (insertAtFront), 21.6 (insertAtBack), 21.7 (removeFromFront) and 21.8 (removeFromBack) that show how to insert a new node in the middle of a linked list and how to remove an existing node from the middle of a linked list.

Figs. 21.5I // Fig. 21.15: Tree.java 2 // TreeNode and Tree class declarations for a binary search tree. 3 package

Figs. 21.6I // Fig. 21.16: TreeTest.java 2 // Binary tree test program. 3 import java.security.SecureRandom; import

Figs. 21.7

6 13 17 27 33 42 48

Figs. 21.8

18 11 19 28 40 32 44 49 71 69 72 83 97 92 99

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java How To Program Late Objects Version

ISBN: 9780136123712

8th Edition

Authors: Paul Deitel, Deitel & Associates

Question Posted: