Floyd-Warshall算法描述 1)適用范圍: a)APSP(All Pairs Shortest Paths) b)稠密圖效果最佳 c)邊權可正可負 2)算法描述: a)初始化:dis[u,v]=w[u,v] b)For k:=1 to n For i:=1 to n For j:=1 to n If dis[i,j]>dis[i,k]+dis[k,j] Then Dis[I,j]:=dis[I,k]+dis[k,j] c)算法結束:dis即為所有點對的最短路徑矩陣 3)算法小結:此算法簡單有效,由于三重循環結構緊湊,對于稠密圖,效率要高于執行|V|次Dijkstra算法。時間復雜度O(n^3)。 考慮下列變形:如(I,j)∈E則dis[I,j]初始為1,else初始為0,這樣的Floyd算法最后的最短路徑矩陣即成為一個判斷I,j是否有通路的矩陣。更簡單的,我們可以把dis設成boolean類型,則每次可以用“dis[I,j]:=dis[I,j]or(dis[I,k]and dis[k,j])”來代替算法描述中的藍色部分,可以更直觀地得到I,j的連通情況。
標簽: Floyd-Warshall Shortest Pairs Paths
上傳時間: 2013-12-01
上傳用戶:dyctj
用C++中的MFC編程實現正軸等角割圓柱投影,實現以下要求: 取克拉索夫斯基橢球 (1)制圖區域: Bs=0°, BN=25° LE=105°, LE=125° (2)經緯線間隔: ΔB=ΔL=5° (3)制圖比例尺: 1:M0=1:1000 000 (4)標準緯線: Bk=±15° 計算經緯網格點的 x, y,m,n, p
上傳時間: 2013-12-29
上傳用戶:himbly
"棧頂運算符為: %c\n",getTop(optr)) printf("此時運算符為:%c\n",e) printf("棧頂運算符優先級低,%c進棧\n",e) push(optr,e) //e進運算符棧
上傳時間: 2016-02-25
上傳用戶:英雄
約瑟夫問題的C語言程序,基本實現其功能,可以輸入N個人數,進行結果計算輸出
標簽: C語言程序
上傳時間: 2013-12-24
上傳用戶:cylnpy
數據結構(嚴慰敏)配套純c代碼實驗十 typedef int InfoType // 定義其它數據項的類型 typedef int KeyType // 定義RedType類型的關鍵字為整型 struct RedType // 記錄類型(同c10-1.h) { KeyType key // 關鍵字項 InfoType otherinfo // 其它數據項 } typedef char KeysType // 定義關鍵字類型為字符型 #include"c1.h" #include"c10-3.h" void InitList(SLList &L,RedType D[],int n) { // 初始化靜態鏈表L(把數組D中的數據存于L中) char c[MAX_NUM_OF_KEY],c1[MAX_NUM_OF_KEY] int i,j,max=D[0].key //
標簽: typedef int InfoType KeyType
上傳時間: 2016-03-03
上傳用戶:2404
The market for miniature computer programming is exploding. C++ Footprint and Performance Optimization supplies programmers the knowledge they need to write code for the increasing number of hand-held devices, wearable computers, and intelligent appliances. This book gives readers valuable knowledge and programming techniques that are not currently part of traditional programming training. In the world of C++ programming, all other things being equal, programs that are smaller and faster are better. C++ Footprint and Performance Optimization contains case studies and sample code to give readers concrete examples and proven solutions to problems that don t have cut and paste solutions.
標簽: Performance programming Optimizati Footprint
上傳時間: 2013-12-09
上傳用戶:wfl_yy
這是一個用C語言寫的禁忌搜索算法的解釋,解決了了一個n后問題,這是一個典型的介紹性的算法代碼。 很不錯
上傳時間: 2014-01-02
上傳用戶:shinesyh
C++讀取Excel AppWizard uses "TODO:" to indicate parts of the source code you should add to or customize. If your application uses MFC in a shared DLL, and your application is in a language other than the operating system s current language, you will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation. For example, MFC42DEU.DLL contains resources translated to German.) If you don t do this, some of the UI elements of your application will remain in the language of the operating system.
標簽: AppWizard indicate custom source
上傳時間: 2016-03-12
上傳用戶:cazjing
對c++的介紹,適合初學者。系外文資料。
標簽:
上傳時間: 2013-12-26
上傳用戶:jjj0202
冒泡法是數據排序的一種基本算法,它的基本方法是:相鄰兩元素進行比較,如有需要則進行交換, 每完成一次循環就將最小元素排在最后(如從大到小排序),下一次循環是將其他的數進行類似操作? 如將N 個數按從大到小排序,Turbo C語言程序函數
上傳時間: 2016-03-20
上傳用戶:趙云興