Question
Given to you declaration class structure in STACK.h and QUEUE.h below. Write testApplication.cpp to solve question below using combination stack and queue structure. There will
Given to you declaration class structure in STACK.h and QUEUE.h below. Write testApplication.cpp to solve question below using combination stack and queue structure. There will one queue object and two stack object.
Read a sentence, enqueue each of the character into a queue. Each time reading the character check it whether it is consonant or vowel. Push consonant character into stack consonant and push vowel character into vowel stack. Inside Queue there were only consonant character leave inside. Example of the output shown as below.
#data structure ..in need please!!!
STACK.h QUEUE.h class STACK class QUEUE { private: NODE *top; int count; private: NODE *front; NODE *rear; int count; public: STACK(); bool stackEmpty(); bool push (DATA dataIn); bool pop (DATA &dataOut); bool stackTop (DATA &dataOut); public: QUEUE (); bool stackEmpty(); bool enqueue (DATA dataIn); bool dequeue (DATA &dataOut); bool queue Front (DATA &dataOut); bool queueRear (DATA &dataOut); }; Insert a sentence: Congratulation You Win a Display Queue: CngrtitnYWn Display Vowel Stack: iuooiauao Display Consonant Stack: nWYntltroncStep 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