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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

算法导论第三版第一章答案

發布時間:2023/12/10 编程问答 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 算法导论第三版第一章答案 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

第一章

1-1 1-2 1-3 1-4 1-5

2-1 2-2 2-3

1-1

Give a real-world example that requires sorting or a real-world example that requires computing a convex hull.
給出現實生活中需要排序的一個例子或者現實生活中需要計算凸殼的一個例子

排序的例子有學校里的成績排名、字典里面單詞按字母排序、網頁按熱度排序等,而計算凸殼的話感覺沒什么例子,好像居民區劃分的時候有可能會用到。

1-2

Other than speed, what other measures of efficiency might one use in a real-world setting?
除速度外,在真實環境中還可能使用哪些其他有關效率的量度?

資源利用率

1-3

Select a data structure that you have seen previously, and discuss its strengths and limitations.
選擇一種以前你已知的數據結構,并討論其優勢和局限

數組,優勢是可隨機存取,劣勢是插入刪除麻煩

1-4

How are the shortest-path and traveling-salesman problems given above similar? How are they different?
前面給出的最短路徑與旅行商問題有哪些相似之處?又有哪些不同?

相似之處是它們都是尋找圖中最短路徑的問題
不同之處是最短路徑問題是找兩個點之間的最短路徑,而旅行商問題則是找出多個點直接的最短路徑

1-5

Come up with a real-world problem in which only the best solution will do. Then come up with one in which a solution that is “approximately” the best is good enough.
提供一個現實生活的問題,其中只有最佳解才行,然后提供一個問題,其中近似最佳的一個解也足夠好

排序問題要一個最佳解,尋找兩個城市的最短路徑一個近似解則足夠

2-1

Give an example of an application that requires algorithmic content at the application level, and discuss the function of the algorithms involved.
給出在應用層需要算法內容的應用的一個例子,并討論涉及的算法的功能

谷歌百度搜索用到了可以完成排序功能和字符串匹配的算法

2-2

Suppose we are comparing implementations of insetion sort and merge sort on the same machine. For inputs of size n,insertion sort runs in 8n2 steps, while merge sort runs in 64nlgn steps. For which values of n does insertion sort beat merge sort?
假設我們正比較插入算法與歸并算法在相同機器上的實現。對規模為n的輸入,插入排序運行8n2步,而歸并排序運行64nlgn步。問對于哪些n值,插入排序優于歸并排序

n<=43時

2-3

What is the smallest value of n such that an algorithm whose running time is 100n2 runs faster than an algorithm whose running time is 2n on the same machine?
n的最小值為何值時,運行時間為100n2的一個算法在相同機器上快于運行時間為2n的另一個算法?

n=15

總結

以上是生活随笔為你收集整理的算法导论第三版第一章答案的全部內容,希望文章能夠幫你解決所遇到的問題。

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