資源簡介
2017--山東大學數據結構實驗代碼,包括實驗1-實驗8,利用codeblocks編譯運行。代碼有詳細的注釋,是輔助學習的好資源。
配套的實驗報告在上一個的上傳資源里面。
2017--山東大學數據結構實驗代碼,包括實驗1-實驗8,利用codeblocks編譯運行。代碼有詳細的注釋,是輔助學習的好資源。
配套的實驗報告在上一個的上傳資源里面。
2017--山東大學數據結構實驗代碼,包括實驗1-實驗8,利用codeblocks編譯運行。代碼有詳細的注釋,是輔助學習的好資源。
配套的實驗報告在上一個的上傳資源里面。

代碼片段和文件信息
#include?
#include?
using?namespace?std;
int?n?cnt?=?0;
int?*a;
/*
?*?permutations:?生成前n個自然數的全排列。
?*?原理:n個數的全排列構成的集合,為將n個數中取出一個放到最前面,每個數分別取出一次,其余n-1個數的全排列的集合的并集。
?*/
void?permutations(int?pos)?{
if?(pos?==?n)?{
for?(int?i?=?0;?i? cout?< cout?< ++cnt;
return;
}
for?(int?i?=?pos;?i? swap(a[pos]?a[i]);
permutations(pos?+?1);
swap(a[pos]?a[i]);
}
}
int?main()?{
cout?<“Please?input?the?number?of?numbers:“?< cout?<“n?=?“;
cin?>>?n;
a?=?new?int[n];
cout?<“Please?input?n?numbers:“?< for?(int?i?=?0;?i? cin?>>?a[i];
permutations(0);
cout?< delete[]?a;
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-01-18?10:58??實驗代碼\
?????目錄???????????0??2017-02-13?19:11??實驗代碼\實驗一\
?????文件?????????843??2017-01-14?22:08??實驗代碼\實驗一\lab1_1.cpp
?????文件?????1048325??2017-01-14?21:42??實驗代碼\實驗一\lab1_1.exe
?????文件????????2203??2017-01-14?21:42??實驗代碼\實驗一\lab1_1.o
?????文件?????????992??2016-12-14?12:58??實驗代碼\實驗一\lab1_2.cpp
?????文件?????1049454??2016-12-14?12:59??實驗代碼\實驗一\lab1_2.exe
?????文件????????4089??2016-12-14?12:59??實驗代碼\實驗一\lab1_2.o
?????目錄???????????0??2018-01-13?23:54??實驗代碼\實驗七\
?????目錄???????????0??2018-01-13?23:54??實驗代碼\實驗七\bin\
?????文件????????5658??2016-12-08?10:29??實驗代碼\實驗七\binaryTree.h
?????文件?????????957??2016-11-30?22:54??實驗代碼\實驗七\BinaryTreeNode.h
?????目錄???????????0??2017-02-28?21:53??實驗代碼\實驗七\bin\Debug\
?????文件?????????613??2016-12-01?15:27??實驗代碼\實驗七\changeLength1D.h
?????文件????????1327??2016-12-07?11:24??實驗代碼\實驗七\exception.h
?????文件????????1518??2016-12-07?19:40??實驗代碼\實驗七\huffmanTree.h
?????文件????????1809??2016-12-01?13:55??實驗代碼\實驗七\li
?????文件???????????2??2017-02-28?21:52??實驗代碼\實驗七\main.cpp
?????文件?????1063673??2016-12-14?13:05??實驗代碼\實驗七\main.exe
?????文件???????23152??2016-12-14?13:05??實驗代碼\實驗七\main.o
?????文件?????????112??2016-12-08?09:26??實驗代碼\實驗七\maxHeap.h
?????文件????????9420??2017-02-28?22:04??實驗代碼\實驗七\maxHeap_.h
?????文件????????3608??2016-12-07?17:49??實驗代碼\實驗七\minHeap.h
?????目錄???????????0??2018-01-13?23:54??實驗代碼\實驗七\obj\
?????目錄???????????0??2018-01-13?23:54??實驗代碼\實驗七\obj\Debug\
?????文件?????????509??2017-02-28?21:52??實驗代碼\實驗七\obj\Debug\main.o
?????文件????????1413??2016-12-07?19:56??實驗代碼\實驗七\sy_7.cbp
?????文件????????1536??2017-02-28?21:52??實驗代碼\實驗七\sy_7.depend
?????文件????????1851??2017-03-01?00:22??實驗代碼\實驗七\sy_7.layout
?????目錄???????????0??2018-01-13?23:59??實驗代碼\實驗三\
?????目錄???????????0??2018-01-13?23:59??實驗代碼\實驗三\bin\
............此處省略170個文件信息
- 上一篇:手寫數字JPG圖片10000張
- 下一篇:yaf框架學習
評論
共有 條評論