日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CS 325 HW

發布時間:2023/12/13 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CS 325 HW 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

代做CS 325作業、代寫C, C++/Python編程設計作業、代做Python/c++實驗作業
CS 325 – HW 5
1. (6 points) Consider an undirected graph G=(V,E) with nonnegative edge weights w(u,v)0. Suppose
that you have computed a minimum spanning tree G, and that you have also computed shortest paths
to all vertices from vertex s?V. Now suppose each edge weight is increased by 1: the new weights
w’(u,v) = w(u,v) + 1.
(a) Does the minimum spanning tree change? Give an example it changes or prove it cannot change.
(b) Do the shortest paths change? Give an example where they change or prove they cannot change.
2. (4 points) In the bottleneck-path problem, you are given a graph G with edge weights, two vertices s
and t and a particular weight W; your goal is to find a path from s to t in which every edge has at least
weight W.
(a) Describe an efficient algorithm to solve this problem.
(b) What is the running time of your algorithm.
3. (5 points) A region contains a number of towns connected by roads. Each road is labeled by the
average number of minutes required for a fire engine to travel to it. Each intersection is labeled with a
circle. Suppose that you work for a city that has decided to place a fire station at location G. (While this
problem is small, you want to devise a method to solve much larger problems).
(a) What algorithm would you recommend be used to find the fastest route from the fire station to
each of the intersections? Demonstrate how it would work on the example above if the fire station is
placed at G. Show the resulting routes.
(b) Suppose one ”optimal” location (maybe instead of G) must be selected for the fire station such that
it minimizes the distance to the farthest intersection. Devise an algorithm to solve this problem given an
arbitrary road map. Analyze the time complexity of your algorithm when there are f possible locations
for the fire station (which must be at one of the intersections) and r possible roads.
(c) In the above graph what is the “optimal” location to place the fire station?
4. (15 points) Suppose there are two types of professional wrestlers: “Babyfaces” (“good guys”) and
“Heels” (“bad guys”). Between any pair of professional wrestlers, there may or may not be a rivalry.
Suppose we have n wrestlers and we have a list of r pairs of rivalries.
CS 325 – HW 5
(a) Give pseudocode for an efficient algorithm that determines whether it is possible to designate some
of the wrestlers as Babyfaces and the remainder as Heels such that each rivalry is between a Babyface
and a Heel. If it is possible to perform such a designation, your algorithm should produce it.
(b) What is the running time of your algorithm?
(c) Implement: Babyfaces vs Heels in C, C++ or Python. Name your program wrestler and include
instructions on how to compile and execute your code in the README file.
Input: Input is read in from a file specified in the command line at run time. The file contains the
number of wrestlers, n, followed by their names, the number of rivalries r and rivalries listed in pairs.
Note: The file only contains one list of rivalries
Output: Results are outputted to the terminal.
Yes, if possible followed by a list of the Babyface wrestlers and a list of the Heels .
No, if impossible.
Sample Input file:
5
Ace
Duke
Jax
Biggs
Stone
6
Ace Duke
Ace Biggs
Jax Duke
Stone Biggs
Stone Duke
Biggs Jax
Sample Output:
Yeshttp://www.daixie0.com/contents/3/1995.html
Babyfaces: Ace Jax Stone
Heels: Biggs Duke
Note: There can be alternative solutions. For consistency assign the first wrestler in the list to be a
Babyface.
Submit a copy of your files including a README file that explains how to compile and run your code in
a ZIP file to TEACH.

?

因為專業,所以值得信賴。如有需要,請加QQ99515681 或郵箱:99515681@qq.com?

微信:codinghelp

轉載于:https://www.cnblogs.com/javanewpython/p/9931347.html

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的CS 325 HW的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。