Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is the given pseudocode. Now I need the code in C++ please Create a listNode class friend of LLStack, LLQueue, Lllist -data (int) next
this is the given pseudocode. Now I need the code in C++ please
Create a listNode class friend of LLStack, LLQueue, Lllist -data (int) next (listNode) Method: - constructor (data) //create a node with given data -printNode (node, outFile) in the format as below: (node's data, data of node's next) @ Create LLQueue class - listNode* head // head always points to the dummy node! - listNode* tail // tail always points to the last node of the queue; tail points to dummy initially. Methods: - constructor (...) // creates a new Queue with a dummy node, set the data in the dummy node to -9999 and sets next to null; let both head and tail point to the dummy node. buildQueue (inFile) // see algorithm below. Implement all other Queue operations on your own. "Use the following queue operations in buildQ. You may add other operations as needed. - inserto (newNode) // insert the newNode after the tail of Q. - listNode deleteQ (...) // if Q is not empty, deletes the first node, after the dummy trom Q and returns the 7/ deleted node, otherwise, returns null bool isEmpty (...) // checks to see if Q is empty, ie tall points to the dummy node. It returns true is Q is empty and false otherwise. print (outFile2) // DO NOT delete nodes in Queue! Outputs to outFile2. the entire o, including the dummy node, you may calling printNode (...) using the following format: Front -->(-9999, next's dato1)--> (dato, next's data)......Ha data, NULL)HE NULL For example: Front-->(-9999, 8)-->(8.11) -->011, 21) 1>(21, 42) HAE (87 NULLI> NULL 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