Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 2 : In class, you were given the source code for building a queue data structure based on a linked list. You are given
Part :
In class, you were given the source code for building a queue data structure based on a linked list. You are given this source code assignpartcpp but it misses the implementation of the "vowelCheck" fuction. You are asked to provide the implementation of this function as described below.
The vowelCheck fucntion receives two queues and copies the elements from the first queue into the second queue when the element value is not vowel.
Hint: Vowel Letters are I,
tabletableExample of Input Queues to the function
Import Notes:
You are NOT allowed to change the parameters given for the "oddCheck" and "vowelCheck" functions. #include
using namespace std;
struct Node
char data;
struct Node next;
;
char peekNode front Node rear return frontdata;
void enqueueNode front Node rear int data
Node newNode new Node;
newNodedata data;
newNodenext NULL;
if front NULL
front newNode;
rear newNode;
else
rearnext newNode;
rear newNode;
char dequeueNode front Node rear
Node temp front;
char x frontdata; or int x temp data;
front frontnext;
if front NULL
rear NULL;
delete temp;
return x;
void printQueueNode front Node rear
iffront NULL
Node curr front;
while currnext NULL
cout currdata ;
curr currnext;
cout currdata ;
cout endl;
void VowelCheckNode front Node rear Node front Node rear
int main
Node front NULL;
Node rear NULL;
Node front NULL;
Node rear NULL;
enqueue&front &rearM;
enqueue&front &rearo;
enqueue&front &rearh;
enqueue&front &reara;
enqueue&front &rearm;
enqueue&front &rearm;
enqueue&front &reara;
enqueue&front &reard;
printQueuefront rear;
VowelCheckfront rear &front &rear;
printQueuefront rear;
return ;
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