Hello, I am in need of some help with this problem given to me here. I don't even know where to start, so if someone could help me get the ball rolling that would be greatly appreciated. Or if you could provide me with some of the definition of divideAt, that would be greatly helpful. Thank you.
Add the following operation to the class linkedListType:
|
void divideAt(linkedListType<Type> &secondList, const Type& item);
| |
//Divide the list at the node with the info item into two sublists.
Postcondition: first and last point to the first and last nodes of the first sublist.secondList.first and secondList.lastpoint to the first and last nodes of the second sublist.
Consider the following statements:
1 2
|
unorderedLinkedList<int> myList;
unorderedLinkedList<int> otherList;
| |
Suppose myList points to the list with the elements 34 65 18 39 27 89 12 (in this order). The statement:
|
myList.divideAt(otherList, 18);
| |
divides myList into two sublists: myList points to the list with the elements 34 65, and otherList points to the sublist with the elements 18 39 27 89 12.