Question: Using STL classes you studied in class, write a main function that performs the following: Defines a queue of integers and reads from the user
Using STL classes you studied in class, write a main function that performs the following:
-
Defines a queue of integers and reads from the user input 100 values and inserts them into the queue.
-
Reverses the queue values such that what is first becomes last. You are not allowed to use a stack in this operation.
-
Move the queue values into two different lists. The first list should contain the values that have duplicates and the second list has the values with no duplicates. The queue should become empty after this.
-
Sort the values in the first list (no duplicates) and print the list values.
c++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
