實現演算法2 1的程式

2021-06-23 05:54:01 字數 641 閱讀 4778

// algo2-1.cpp 實現演算法2.1的程式

#include"c1.h"

typedef int elemtype;

#include"c2-1.h" // 採用線性表的動態分配順序儲存結構

#include"bo2-1.cpp" // 可以使用bo2-1.cpp中的基本操作

#include"func2-3.cpp" // 包括equal()、comp()、print()、print2()和print1()函式

void union(sqlist &la,sqlist lb) // 演算法2.1

elemtype e;

int la_len,lb_len;

int i;

la_len=listlength(la); // 求線性表的長度

lb_len=listlength(lb);

for(i=1;i<=lb_len;i++)

}void main()

執行後的結果;

/*

la= 1 2 3 4 5

lb= 2 4 6 8 10

new la= 1 2 3 4 5 6 8 10

*/

實現演算法2 1的程式

algo2 1.cpp 實現演算法2.1的程式 include c1.h typedef int elemtype include c2 1.h 採用線性表的動態分配順序儲存結構 include bo2 1.cpp 可以使用bo2 1.cpp中的基本操作 include func2 3.cpp 包括...

用單鏈表實現演算法2 1

algo2 12.cpp 用單鏈表實現演算法2.1,僅有4句與algo2 1.cpp不同 include c1.h typedef int elemtype include c2 2.h 此句與algo2 1.cpp不同 因為採用不同的結構 include bo2 2.cpp 此句與algo2 1....

Dinic演算法的程式實現

program poj 1273 dinic author comzyh include include include include define min x,y x0 if dis n 0 return 1 else return 0 匯點的dis小於零,表明bfs不到匯點 find代表一次增...