$24
Problem 1 (Exercise 16.13)
Use the algorithm from Section 16.5 to implement the PriorityQueue class so that it uses a heap as its underlying representation. To eliminate some of the complexity, feel free to use a vector instead of a dynamic array.
Requirments:
Please finish the fileP1PriorityQueue.h.
Problem 2
Part1: (Exercise 18.03)
Eliminate the recursion from the implementation of DepthFirstSearch by using a stack to store the unexplored nodes. At the beginning of the algorithm, you simply push the starting node on the stack. Then, until the stack is empty, you repeat the following operations: 1. Pop the topmost node from the stack; 2. Visit that node; 3. Push its neighbors on the stack.
Part2: (Exercise 18.04)
Finish the implementation of BreadthFirstSearch. Take your solution from the preceding exercise and replace the stack with a queue.
Requirments:
Please finish the file P2Traverse.cpp according to the file P2Traverse.h. Note that, in the implementation of DepthFirstSearch, you must use stack. The students using recursion will get zero point.
Requirements for Assignment
We have provided a project named as AS6 ID.pro. Firstly, please replace the ID with your student ID in both .pro file and the project folder name. (e.g. if your student ID is 123456, hereby the file should be named asAS6 123456),
You should finish P1PriorityQueue.h and P2Traverse.cpp according to the problem require-ments. The resources and test files are provided underres folder. You can use them with relative path directly after you compile the whole project. Finally, pack your whole project files into a single .zip file, and submit the .zip file via BB system.
Please note that, the teaching assistant may ask you to explain the meaning of your program, to ensure that the codes are indeed written by yourself. Please also note that we may check whether your program is too similar to your fellow students’ code using BB.
Please refer to the BB system for the assignment deadline. For each day of late submission, you will obtain late penalty in the assignment marks.
Reminder: Please switch your input language to English before interacting in Stanford console.
Or, you will get no response.