Starting from:
$30

$24

Homework 3 Solution

You will need to submit a written report with part of your codes and your source code via Blackboard. You also need to bring in a hard copy of the report with part of your codes to the class on the day that this is due.

Name your header file as LastName(3 to 5 letters)_FirstNameInitial_HW4_QX.h and your implementation file as LastName(3 to 5 letters)_FirstNameInitial_HW4_QX.cpp

Note: You can only use iostream, cassert, cmath, cstdio, and cstdlib.

All the following classes are to be implemented as template.

1. Write your own class of stack using Dynamic array with:

a. The basic functions

b. A swap member function that swaps two stacks without changing the order

2. Write your own class of queue using Dynamic array with:

a. The basic functions

b. A swap member function that swaps two queues without changing the order

3. Write your own class of priority queue using Dynamic array with:

a. The basic functions

4. Write a class using two stacks of your stack class to simulate a queue and their basic

functions.

5. Write a class using two queues of your queue class to simulate a stack and their basic

functions.










Example structures of the report:

1. An overview of this homework

2. Header file for question 1

3. Implementation file for question 1

4. Header file for question 2

5. Implementation file for question 2

6. Header file for question 3

7. Implementation file for question 3

8. Header file for question 4

9. Implementation file for question 4

10. Explain how your simulated queue works

11. Header file for question 5

12. Implementation file for question 5

13. Explain how your simulated stack works

14. Any improvements, problems, etc. of the class/functions

15. Code for header file

Code should be Consolas font size 8 to 10.

More products