Design and implement a dynamic linked queue (FIFO – first-in, first-out) using C
ID: 3736066 • Letter: D
Question
Design and implement a dynamic linked queue (FIFO – first-in, first-out) using C++ classes including the following methods:
o isEmpty ( ) - returns an integer or enumerated bool type; true for an empty queue, false for non-empty queue
o enqueue ( ) - allocates a node dynamically; initializes it to the data passed in; inserts the node at the tail/e of the queue only; returns true or false for successful or unsuccessful insertion, respectively
o dequeue ( ) - de-allocates a node at the head/front of the queue dynamically; returns the data in the node found at the head/front of the queue; NOTE: some implementations may also return true or false for successful or unsuccessful removal of a node from the head/front
o printQueue ( ) - prints out the data in each node of the queue; may be printed iteratively or recursively
Explanation / Answer
Following is the Program written in c++:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.