Starting from:

$24.99

CSC3002 Problem 1 Solution

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 file P1PriorityQueue.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 as AS6 123456),
You should finish P1PriorityQueue.h and P2Traverse.cpp according to the problem requirements. The resources and test files are provided under res 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.
Reminder: Please switch your input language to English before interacting in Stanford console.
Or, you will get no response.

More products