ECS 32B: Winter 2019


ECS 32B: Winter 2019
Homework Assignment 6
Due Date: No later than Friday, March 15, 9:00pm. 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.

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱:[email protected] 

微信:codinghelp

猜你喜欢

转载自www.cnblogs.com/whltay/p/10548236.html
今日推荐