Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ for beginners libraries please #include #include Problem Statement: Based on the queue Type class we develop in chapter 8, you are asked to

image text in transcribed

in c++ for beginners libraries please #include #include

Problem Statement: Based on the queue Type class we develop in chapter 8, you are asked to add the following operations: 1. Modify the addQueue operation to be addOrder, so that the items will be inserted into the queue in ascending order. 2. Add moveNthFront function as a none-member function to move the nth element of the queue to the front. 3. Add mirror Queue function as a none-member function to duplicate the items in the queue in reverse order. Programing Specifications: 1. Your are asked to develop a class named queue Type with the following set of member functions: . A class constructor to initialize the data members. The removeQueue function to remove an item from the queue. The front function to return the item at the front of the queu. The addOrder function to insert new value into the queue in its position such that all elements in the queue are in ascending order. . . . 2. Your are asked to develop the following none-member functions: The moveNthFront function that takes as a parameter a positive integer, n. The function moves the nth element of the queue to the front. The order of the remaining elements remains unchanged. For example, suppose queue = {5, 11, 34, 67, 43, 55) and n = 3. After a call to the function moveNthFront, queue = {34, 5, 11, 67, 43, 55). The mirrorQueue function that duplicate the content of the queue in reverse order. For example, suppose queue = {10, 20, 30, 40, 50). After a call to the function mirror Queue, queue = {10, 20, 30, 40, 50, 50, 40, 30, 20, 10). . Important Notes: You are asked to implement the mirror Queue / moveNthFront functions using stack and queue objects only, any other structures are not allowed. (Hint: Declare stack and queue structures defined in C++ STL )

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 Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions