Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 2 Lncs 13427

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124251, 978-3031124259

More Books

Students also viewed these Databases questions