need help with implementing such an operation for theDoubylinked list. For doing this, The following class should
Question:
need help with implementing such an operation for theDoubylinked 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
Business Statistics In Practice
ISBN: 9780073401836
6th Edition
Authors: Bruce Bowerman, Richard O'Connell