當且僅當從任意頂點開始的廣度優先遍歷中的獲得的頂點數等於圖中所含的頂點數時,圖是連通的html
1.3最小生成樹
生成樹(spanning tree)是包含圖中全部頂點及圖中部分邊的一棵樹。最小生成樹是其所含邊的權值之和小於等於圖的任意其餘生成樹的邊的權值之和的生成樹git
1.4斷定最小路徑
圖有兩種最短路徑的斷定定義,一是斷定兩個頂點之間邊數最少的路徑,二是在帶權圖中找到最短路徑算法
if (data[scan].compareTo(data[scan + 1]) < 0)
,即經過比較將小的值放到右邊,獲得逆序的隊列排序。測試截圖以下。(statistics.sh腳本的運行結果截圖)數據結構
When removing an element from a binary search tree, we must always ______________________. A . make sure that the new tree is a binary search tree B . build a new tree C . find its inorder successor D . remove all of its children E . An element should never be removed from a binary search tree.
解答:我選的是C,由於教材上說過,當刪除一個元素時,須要找到它在中序遍歷的後一個元素來代替。正確答案是A,由於找代替的前提是肯定子樹是一個新的二叉查找樹。app
In a balanced binary search tree, adding an element always requires approximately O(log2 n) steps. A . true B . false
解答:這句話是正確的,在二進制搜索樹中添加一個元素須要與查找元素同樣多的步驟。因爲加入了尋找一個平衡的二叉搜索樹的元素老是須要O(log2n)的步驟,添加一個元素也同樣。學習
Chase the wind and touch the sky,A stars light shines on long after it dies,In the night,Live everyday as if it's your last.堅持下去,加油!測試
代碼行數(新增/累積) | 博客量(新增/累積) | 學習時間(新增/累積) | 重要成長 | |
---|---|---|---|---|
目標 | 5000行 | 30篇 | 400小時 | |
第一週 | 188 | 1/1 | 25 | 算法分析 |
第二週 | 70/258 | 1/2 | 15/40 | 《構建之法》7-9章 |
第三週 | 474/732 | 1/3 | 20/60 | 查找和排序 |
第四五六週 | 1313/2045 | 4/7 | 12/72 | 棧和隊列 |
第七週 | 890/2935 | 1/8 | 14/86 | 樹 |
第八週 | 913/3848 | 1/9 | 20/106 | 二叉查找樹 |
第九周 | 890/3738 | 1/10 | 13/119 | 堆 |
第十週 | 637/4374 | 2/12 | 18/137 | 圖 |
第十一週 |
(有空多看看現代軟件工程 課件 軟件工程師能力自我評價表)ui