Examly題庫立即開始練習
國中教甄|資訊科技資訊科技112 年第 71 題單選題

以下演算法為何種演算法? Mark the current vertex, u, visited and enter it in the discovery order list for each vertex, v, adjacent to the current vertex, u if v has not been visited Set parent of v to u. Recursively apply this algorithm starting at v. Mark u finished and enter u into the finish order list.

A深度優先搜尋正確答案
B線性搜尋
C廣度優先搜尋
D二元搜尋
答案與詳解
A
正確答案
題目描述使用遞迴方式走訪相鄰頂點,並記錄發現與完成順序,此為深度優先搜尋(DFS)的典型特徵。

為什麼答案是 A

深度優先搜尋(DFS)利用遞迴或堆疊(Stack)來走訪圖形,會一路往深處探索直到無路可走才回溯,並會記錄節點的發現與完成時間。

載入中…

資訊科技 相關題目

想練更多資訊科技考古題?

Examly 收錄 38 萬+ 道歷屆題目,每題都有像這樣的精選詳解。免費下載,立即開練。

黑皮