Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Homework Assignment 6
Submit your solutions via Canvas in one
file named “hw6.py”.
1. (40 points) Programming Exercise 8 from Chapter 6 of your textbook. Think “heapsort”. Use
the code given in the textbook as your foundation. Reminder: do not use outside sources, including
the Internet, in deriving your solution to this problem or the next.
2. (40 points) Given the following graphs:
2a. Write the names of the vertices (cities) in the order you would visit them if you performed
a breadth-first traversal of Graph A, starting with the vertex named Frankfurt.
2b. Write the names of the vertices (cities) in the order you would visit them if you performed
a breadth-first traversal of Graph B, starting with the vertex named Frankfurt.
2c. Write the names of the vertices (cities) in the order you would visit them if you performed
a depth-first traversal of Graph A, starting with the vertex named Frankfurt.
2d. Write the names of the vertices (cities) in the order you would visit them if you performed
a depth-first traversal of Graph B, starting with the vertex named Frankfurt.
Note that Graph A is undirected and Graph B is directed. You may ignore any weights on edges.
Submit your solutions to Problem 2 as comments in the “hw6.py” file that also contains your
solution to Problem 1.