graph-Dijkstra's shortest-path alogorithm

直接貼代碼吧,簡明易懂。 後面自己寫了測試,輸入數據爲: a b c d e 0 1 4 0 2 2 1 2 3 1 3 2 1 4 3 2 1 1 2 3 4 2 4 5 4 3 1 也就是課本上111的圖4.9(上面爲原圖,下面爲結果) 程序的輸出結果爲: #include <iostream> #include <string> using namespac
本站公眾號
   歡迎關注本站公眾號,獲取更多信息