I need help with implementing such an operation for the singlylinked list. For doing this, The following
Question:
I need help with implementing such an operation for the singlylinked list. For doing this, The following class should be used (DoubleNode, DoublyLinkedList.). As these driver classes are making calls to a new method "changeElem", which should have the following signature: void changeElem(String oldStr, String newStr)
I need help with implementing such a method, in the following file: DoublyLinkedList.
Inside this method, you are allowed to call the "search" method at the beginning, to get the node containing the oldStr. But after that, you should not make calls to existing methods.
Here are the steps to help for making the implementing:
? change the value inside that node (hint: you will need to implement a mutator method in the node class) ? if the new value is still smaller than the next node, or if there are no more nodes, then do nothing (stop there) ? disconnect the node from the list for now
? find the new place of the node (by iterating from that point on up until you find its place - next node is larger or we are at the end of the list)
? insert the node at that place
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young