Question
C++ Instructions Derive the class intLinkedList from the class unorderedLinkedList as follows: class intLinkedList: public unorderedLinkedList { public: void splitEvenOddList(intLinkedList &evenList, intLinkedList &oddList); //Function to
C++
Instructions
Derive the class intLinkedList from the class unorderedLinkedList as follows:
class intLinkedList: public unorderedLinkedList{ public: void splitEvenOddList(intLinkedList &evenList, intLinkedList &oddList); //Function to rearrange the nodes of the linked list so //that evenList consists of even integers and oddList //consists of odd integers. //Postcondition: evenList consists of even integers. // oddList consists of odd integers. // The original list is empty. };
Also write the definition of the function splitEvensOddsList. Note that this function does not create any new node, it only rearranges the nodes of the original list so that nodes with even integers are in evensList and nodes with odd integers are in oddsList.
2. Write a program that uses class intLinkedList to create a linked list of integers and then uses the function splitEvensOddsList to split the list into two sublists.
Main.cpp
#include
using namespace std;
int main() {
// Write your main here
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started