├── chapter 9 ├── test.txt.bak ├── HASH_TABLE.txt ├── BTree_Data.txt ├── BiTree.h ├── BiTree.cpp ├── LinkQueue.h ├── sq_stack.h ├── type_def.h ├── LinkQueue.cpp ├── hash_table.cpp ├── hash_table.h ├── sq_stack.cpp ├── dynamic_search.h ├── static_search.h ├── dynamic_search.cpp ├── static_search.cpp ├── test.txt ├── main.cpp ├── MyHeader.h ├── chapter 9.sln ├── chapter 9.vcxproj.filters └── chapter 9.vcxproj ├── chapter 10 ├── chapter 10 │ ├── SqList_Data.txt │ ├── RADIX_DATA.txt │ ├── sqlist.h │ ├── radix_sort.h │ ├── sqlist.cpp │ ├── type_def.h │ ├── insert_sort.h │ ├── merge_sort.cpp │ ├── quick_sort.cpp │ ├── radix_sort.cpp │ ├── select_sort.h │ ├── insert_sort.cpp │ ├── select_sort.cpp │ ├── merge_sort.h │ ├── MyHeader.h │ ├── quick_sort.h │ ├── main.cpp │ ├── chapter 10.vcxproj.filters │ └── chapter 10.vcxproj └── chapter 10.sln ├── chapter 3 ├── SqQueue.h ├── Algorithm.h ├── LinkQueue.h ├── SqQueue.cpp ├── sq_stack.h ├── type_def.h ├── Algorithm.cpp ├── LinkQueue.cpp ├── sq_stack.cpp ├── main.cpp ├── chapter 3.sln ├── chapter 3.vcxproj.filters └── chapter 3.vcxproj ├── chapter 4 ├── HString.h ├── HSring.cpp ├── algorithm.cpp ├── type_def.h ├── algorithm.h ├── main.cpp ├── chapter 4.sln ├── chapter 4.vcxproj.filters └── chapter 4.vcxproj ├── chapter 5 ├── array.cpp ├── array.h ├── type_def.h ├── main.cpp ├── chapter 5.sln ├── chapter 5.vcxproj.filters └── chapter 5.vcxproj ├── chapter 6 ├── BiTree.h ├── CSTree.h ├── SqQueue.h ├── BiThrTree.h ├── BiTree.cpp ├── LinkQueue.h ├── SqQueue.cpp ├── sq_stack.h ├── type_def.h ├── BiThrTree.cpp ├── HuffmanTree.h ├── LinkQueue.cpp ├── sq_stack.cpp ├── HuffermanTree.cpp ├── MyHeader.h ├── main.cpp ├── chapter 6.sln ├── chapter 6.vcxproj.filters └── chapter 6.vcxproj ├── chapter 7 ├── CSTree.h ├── DFS_BFS.h ├── graph.cpp ├── graph.h ├── main.cpp ├── DFS_BFS.cpp ├── LinkQueue.h ├── sq_stack.h ├── type_def.h ├── LinkQueue.cpp ├── sq_stack.cpp ├── MyHeader.h ├── chapter 7.sln ├── chapter 7.vcxproj.filters └── chapter 7.vcxproj ├── datas ├── 线性表的存储练习.doc ├── 堆栈和队列的入、出练习.doc └── 实验报告1_链表的数据结构.doc ├── chapter 1 └── problems │ ├── 1-16.c │ ├── 1-19.c │ └── 1-20.c ├── chapter 2 └── textbook │ ├── Sqlist │ ├── main.cpp │ ├── sqlist.h │ ├── sqlist.cpp │ ├── obj │ │ └── Debug │ │ │ ├── main.o │ │ │ └── sqlist.o │ ├── bin │ │ └── Debug │ │ │ └── Sqlist.exe │ ├── Sqlist.depend │ ├── Sqlist.layout │ └── Sqlist.cbp │ └── LinkList │ ├── LinkList.cpp │ ├── obj │ └── Debug │ │ ├── main.o │ │ └── LinkList.o │ ├── bin │ └── Debug │ │ └── LinkList.exe │ ├── LinkList.depend │ ├── LinkList.layout │ ├── main.cpp │ ├── LinkList.h │ └── LinkList.cbp ├── README.md ├── .gitattributes └── .gitignore /chapter 9/test.txt.bak: -------------------------------------------------------------------------------- 1 | 21 20 12 13 15 19 11 -------------------------------------------------------------------------------- /chapter 9/HASH_TABLE.txt: -------------------------------------------------------------------------------- 1 | 19 14 23 1 68 20 84 27 55 11 10 79 -------------------------------------------------------------------------------- /chapter 10/chapter 10/SqList_Data.txt: -------------------------------------------------------------------------------- 1 | 49 38 65 97 76 13 27 49 -------------------------------------------------------------------------------- /chapter 9/BTree_Data.txt: -------------------------------------------------------------------------------- 1 | 45 24 53 90 3 12 37 50 61 70 100 30 26 85 7 -------------------------------------------------------------------------------- /chapter 10/chapter 10/RADIX_DATA.txt: -------------------------------------------------------------------------------- 1 | 278 109 63 930 589 184 505 269 8 83 -------------------------------------------------------------------------------- /chapter 3/SqQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/SqQueue.h -------------------------------------------------------------------------------- /chapter 4/HString.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 4/HString.h -------------------------------------------------------------------------------- /chapter 5/array.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 5/array.cpp -------------------------------------------------------------------------------- /chapter 5/array.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 5/array.h -------------------------------------------------------------------------------- /chapter 6/BiTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/BiTree.h -------------------------------------------------------------------------------- /chapter 6/CSTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/CSTree.h -------------------------------------------------------------------------------- /chapter 6/SqQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/SqQueue.h -------------------------------------------------------------------------------- /chapter 7/CSTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/CSTree.h -------------------------------------------------------------------------------- /chapter 7/DFS_BFS.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/DFS_BFS.h -------------------------------------------------------------------------------- /chapter 7/graph.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/graph.cpp -------------------------------------------------------------------------------- /chapter 7/graph.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/graph.h -------------------------------------------------------------------------------- /chapter 7/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/main.cpp -------------------------------------------------------------------------------- /chapter 9/BiTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/BiTree.h -------------------------------------------------------------------------------- /datas/线性表的存储练习.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/datas/线性表的存储练习.doc -------------------------------------------------------------------------------- /chapter 3/Algorithm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/Algorithm.h -------------------------------------------------------------------------------- /chapter 3/LinkQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/LinkQueue.h -------------------------------------------------------------------------------- /chapter 3/SqQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/SqQueue.cpp -------------------------------------------------------------------------------- /chapter 3/sq_stack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/sq_stack.h -------------------------------------------------------------------------------- /chapter 3/type_def.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/type_def.h -------------------------------------------------------------------------------- /chapter 4/HSring.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 4/HSring.cpp -------------------------------------------------------------------------------- /chapter 6/BiThrTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/BiThrTree.h -------------------------------------------------------------------------------- /chapter 6/BiTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/BiTree.cpp -------------------------------------------------------------------------------- /chapter 6/LinkQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/LinkQueue.h -------------------------------------------------------------------------------- /chapter 6/SqQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/SqQueue.cpp -------------------------------------------------------------------------------- /chapter 6/sq_stack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/sq_stack.h -------------------------------------------------------------------------------- /chapter 6/type_def.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/type_def.h -------------------------------------------------------------------------------- /chapter 7/DFS_BFS.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/DFS_BFS.cpp -------------------------------------------------------------------------------- /chapter 7/LinkQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/LinkQueue.h -------------------------------------------------------------------------------- /chapter 7/sq_stack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/sq_stack.h -------------------------------------------------------------------------------- /chapter 7/type_def.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/type_def.h -------------------------------------------------------------------------------- /chapter 9/BiTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/BiTree.cpp -------------------------------------------------------------------------------- /chapter 9/LinkQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/LinkQueue.h -------------------------------------------------------------------------------- /chapter 9/sq_stack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/sq_stack.h -------------------------------------------------------------------------------- /chapter 9/type_def.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/type_def.h -------------------------------------------------------------------------------- /datas/堆栈和队列的入、出练习.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/datas/堆栈和队列的入、出练习.doc -------------------------------------------------------------------------------- /chapter 3/Algorithm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/Algorithm.cpp -------------------------------------------------------------------------------- /chapter 3/LinkQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/LinkQueue.cpp -------------------------------------------------------------------------------- /chapter 3/sq_stack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 3/sq_stack.cpp -------------------------------------------------------------------------------- /chapter 4/algorithm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 4/algorithm.cpp -------------------------------------------------------------------------------- /chapter 6/BiThrTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/BiThrTree.cpp -------------------------------------------------------------------------------- /chapter 6/HuffmanTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/HuffmanTree.h -------------------------------------------------------------------------------- /chapter 6/LinkQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/LinkQueue.cpp -------------------------------------------------------------------------------- /chapter 6/sq_stack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/sq_stack.cpp -------------------------------------------------------------------------------- /chapter 7/LinkQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/LinkQueue.cpp -------------------------------------------------------------------------------- /chapter 7/sq_stack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 7/sq_stack.cpp -------------------------------------------------------------------------------- /chapter 9/LinkQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/LinkQueue.cpp -------------------------------------------------------------------------------- /chapter 9/hash_table.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/hash_table.cpp -------------------------------------------------------------------------------- /chapter 9/hash_table.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/hash_table.h -------------------------------------------------------------------------------- /chapter 9/sq_stack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/sq_stack.cpp -------------------------------------------------------------------------------- /datas/实验报告1_链表的数据结构.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/datas/实验报告1_链表的数据结构.doc -------------------------------------------------------------------------------- /chapter 1/problems/1-16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 1/problems/1-16.c -------------------------------------------------------------------------------- /chapter 1/problems/1-19.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 1/problems/1-19.c -------------------------------------------------------------------------------- /chapter 1/problems/1-20.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 1/problems/1-20.c -------------------------------------------------------------------------------- /chapter 9/dynamic_search.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/dynamic_search.h -------------------------------------------------------------------------------- /chapter 9/static_search.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/static_search.h -------------------------------------------------------------------------------- /chapter 6/HuffermanTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 6/HuffermanTree.cpp -------------------------------------------------------------------------------- /chapter 9/dynamic_search.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/dynamic_search.cpp -------------------------------------------------------------------------------- /chapter 9/static_search.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 9/static_search.cpp -------------------------------------------------------------------------------- /chapter 10/chapter 10/sqlist.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/sqlist.h -------------------------------------------------------------------------------- /chapter 10/chapter 10/radix_sort.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/radix_sort.h -------------------------------------------------------------------------------- /chapter 10/chapter 10/sqlist.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/sqlist.cpp -------------------------------------------------------------------------------- /chapter 10/chapter 10/type_def.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/type_def.h -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/Sqlist/main.cpp -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/sqlist.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/Sqlist/sqlist.h -------------------------------------------------------------------------------- /chapter 10/chapter 10/insert_sort.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/insert_sort.h -------------------------------------------------------------------------------- /chapter 10/chapter 10/merge_sort.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/merge_sort.cpp -------------------------------------------------------------------------------- /chapter 10/chapter 10/quick_sort.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/quick_sort.cpp -------------------------------------------------------------------------------- /chapter 10/chapter 10/radix_sort.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/radix_sort.cpp -------------------------------------------------------------------------------- /chapter 10/chapter 10/select_sort.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/select_sort.h -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/sqlist.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/Sqlist/sqlist.cpp -------------------------------------------------------------------------------- /chapter 10/chapter 10/insert_sort.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/insert_sort.cpp -------------------------------------------------------------------------------- /chapter 10/chapter 10/select_sort.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 10/chapter 10/select_sort.cpp -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/LinkList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/LinkList/LinkList.cpp -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/LinkList/obj/Debug/main.o -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/Sqlist/obj/Debug/main.o -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/obj/Debug/sqlist.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/Sqlist/obj/Debug/sqlist.o -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/bin/Debug/Sqlist.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/Sqlist/bin/Debug/Sqlist.exe -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/obj/Debug/LinkList.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/LinkList/obj/Debug/LinkList.o -------------------------------------------------------------------------------- /chapter 9/test.txt: -------------------------------------------------------------------------------- 1 | 65 a 1 2 | 66 b 1 3 | 67 c 2 4 | 68 d 5 5 | 69 e 3 6 | 70 f 4 7 | 71 g 4 8 | 72 h 3 9 | 73 i 5 10 | 74 j 6 11 | 75 k 7 -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/bin/Debug/LinkList.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awyd234/DS_yan/HEAD/chapter 2/textbook/LinkList/bin/Debug/LinkList.exe -------------------------------------------------------------------------------- /chapter 4/type_def.h: -------------------------------------------------------------------------------- 1 | #ifndef _TYPE_DEF_H_ 2 | #define _TYPE_DEF_H_ 3 | 4 | #define OK 1 5 | #define ERROR 0 6 | #define TRUE 1 7 | #define FALSE 0 8 | #define OVERFLOW -2 9 | 10 | typedef int Status; 11 | 12 | #endif -------------------------------------------------------------------------------- /chapter 7/MyHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef _MYHEADER_H_ 2 | #define _MYHEADER_H_ 3 | 4 | #include "type_def.h" 5 | #include "graph.h" 6 | #include "CSTree.h" 7 | #include "LinkQueue.h" 8 | #include "sq_stack.h" 9 | #include "DFS_BFS.h" 10 | 11 | #endif -------------------------------------------------------------------------------- /chapter 5/type_def.h: -------------------------------------------------------------------------------- 1 | #ifndef _TYPE_DEF_H_ 2 | #define _TYPE_DEF_H_ 3 | 4 | #define OK 1 5 | #define ERROR 0 6 | #define TRUE 1 7 | #define FALSE 0 8 | #define OVERFLOW -2 9 | 10 | typedef int Status; 11 | typedef int ElemType; 12 | 13 | #endif -------------------------------------------------------------------------------- /chapter 4/algorithm.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALGORITHM_H_ 2 | #define _ALGORITHM_H_ 3 | 4 | #include "HString.h" 5 | 6 | int Index_KMP(HString S, HString T, int pos); 7 | void get_next(HString S, int next[]); 8 | void get_nextval(HString T, int nextval[]); 9 | 10 | #endif -------------------------------------------------------------------------------- /chapter 9/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "MyHeader.h" 5 | 6 | int main(){ 7 | HashTable H; 8 | CreateHashTable(H, "HASH_TABLE.txt"); 9 | DisplayHashTable(H); 10 | printf("\n"); 11 | system("pause"); 12 | return 0; 13 | } -------------------------------------------------------------------------------- /chapter 10/chapter 10/merge_sort.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERGE_SORT_H_ 2 | #define _MERGE_SORT_H_ 3 | 4 | #include "MyHeader.h" 5 | 6 | void Merge(int SR[], int TR[], int i, int m, int n); 7 | void MSort(int SR[], int TR1[], int s, int t); 8 | void MergeSort(SqList &L); 9 | 10 | #endif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DS_yan 2 | ====== 3 | 4 | 《数据结构(C语言版)》严蔚敏4th版code 5 | 前2章是CodeBlocks的工程, 每种数据结构及习题都分别存于一个文件夹中 6 | 后面的是VS2013的工程,所有代码与习题在同一个文件夹中 7 | 部分代码有参考 (徐哲钊 https://github.com/xuzhezhaozhao/DS_Code) 8 | 时间紧张,有些地方不够严谨,欢迎提出批评意见 9 | 联系方式:awyd234@qq.com 10 | 作者:胡骞 11 | -------------------------------------------------------------------------------- /chapter 9/MyHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef _MYHEADER_H_ 2 | #define _MYHEADER_H_ 3 | 4 | #include "type_def.h" 5 | #include "BiTree.h" 6 | #include "sq_stack.h" 7 | #include "LinkQueue.h" 8 | #include "static_search.h" 9 | #include "dynamic_search.h" 10 | #include "hash_table.h" 11 | 12 | #endif -------------------------------------------------------------------------------- /chapter 10/chapter 10/MyHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef _MYHEADER_H_ 2 | #define _MYHEADER_H_ 3 | 4 | #include "type_def.h" 5 | #include "sqlist.h" 6 | #include "insert_sort.h" 7 | #include "quick_sort.h" 8 | #include "select_sort.h" 9 | #include "merge_sort.h" 10 | #include "radix_sort.h" 11 | 12 | #endif -------------------------------------------------------------------------------- /chapter 6/MyHeader.h: -------------------------------------------------------------------------------- 1 | #ifndef _MYHEADER_H_ 2 | #define _MYHEADER_H_ 3 | 4 | #include "type_def.h" 5 | #include "HuffmanTree.h" 6 | #include "BiTree.h" 7 | #include "BiThrTree.h" 8 | #include "sq_stack.h" 9 | #include "SqQueue.h" 10 | #include "LinkQueue.h" 11 | #include "CSTree.h" 12 | 13 | #endif -------------------------------------------------------------------------------- /chapter 6/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "MyHeader.h" 5 | 6 | int main(){ 7 | BiThrTree T,Thrt; 8 | CreateBiThrTree(T); 9 | InOrderThreading(Thrt, T); 10 | InOrderTraverse_Thr(T, PrintElement); 11 | printf("\n"); 12 | system("pause"); 13 | return 0; 14 | } -------------------------------------------------------------------------------- /chapter 10/chapter 10/quick_sort.h: -------------------------------------------------------------------------------- 1 | #ifndef _QUICK_SORT_H_ 2 | #define _QUICK_SORT_H_ 3 | 4 | #include "MyHeader.h" 5 | 6 | int PartionA(SqList &L, int low, int high); 7 | int PartionB(SqList &L, int low, int high); 8 | void QSort(SqList &L, int low, int high); 9 | void QuickSort(SqList &L); 10 | 11 | #endif -------------------------------------------------------------------------------- /chapter 5/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "array.h" 5 | 6 | int main(){ 7 | Array A; 8 | InitArray(A, 3, 1, 2, 3); 9 | int i, j, k, off; 10 | ElemType count = 0; 11 | for (i = 0; i < 1; i++) 12 | for (j = 0; j < 2; j++) 13 | for (k = 0; k < 3; k++, count++) 14 | Value(A, count, i, j, k); 15 | Destroy(A); 16 | system("pause"); 17 | return 0; 18 | } -------------------------------------------------------------------------------- /chapter 3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "SqQueue.h" 5 | 6 | int main(){ 7 | SqQueue Q; 8 | InitQueue(Q); 9 | EnQueue(Q, 1); 10 | EnQueue(Q, 2); 11 | EnQueue(Q, 3); 12 | QueueTraverse(Q, Visit_Display_Int_SQ); 13 | QElemType e; 14 | DeQueue(Q,e); 15 | QueueTraverse(Q,Visit_Display_Int_SQ); 16 | DestroyQueue(Q); 17 | system("pause"); 18 | return 0; 19 | } -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/Sqlist.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1398440954 source:e:\interests\data structure _ yan\chapter 2\textbook\sqlist\main.cpp 3 | 4 | 5 | "sqlist.h" 6 | 7 | 1398439916 e:\interests\data structure _ yan\chapter 2\textbook\sqlist\sqlist.h 8 | 9 | 1398440069 source:e:\interests\data structure _ yan\chapter 2\textbook\sqlist\sqlist.cpp 10 | 11 | 12 | "sqlist.h" 13 | 14 | -------------------------------------------------------------------------------- /chapter 4/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "HString.h" 5 | #include "algorithm.h" 6 | 7 | int main(){ 8 | HString S, T, V; 9 | S.ch = T.ch= V.ch = NULL; 10 | StrAssign(S, "asadas"); 11 | StrAssign(S, "acabaabaabcacaabc"); 12 | StrAssign(V, "12321"); 13 | StrAssign(T, "abaabcac"); 14 | printf("%d\n",Index_KMP(S, T, 1)); 15 | //StrDelete(S, 2, 3); 16 | //StrInsert(S, 3, T); 17 | for (int i = 0; i < S.length; i++) 18 | printf("%c", S.ch[i]); 19 | printf("\n%d\n", StrLength(S)); 20 | Destroy(S); 21 | Destroy(T); 22 | Destroy(V); 23 | system("pause"); 24 | return 0; 25 | } -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/LinkList.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1398523824 source:e:\interests\data structure _ yan\chapter 2\textbook\linklist\main.cpp 3 | 4 | 5 | "LinkList.h" 6 | 7 | 1398523779 e:\interests\data structure _ yan\chapter 2\textbook\linklist\linklist.h 8 | 9 | 1398523884 source:e:\interests\data structure _ yan\chapter 2\textbook\linklist\linklist.cpp 10 | "LinkList.h" 11 | 12 | 1400295104 source:e:\interests\ds_yan\chapter 2\textbook\linklist\linklist.cpp 13 | 14 | 15 | "LinkList.h" 16 | 17 | 1400294845 e:\interests\ds_yan\chapter 2\textbook\linklist\linklist.h 18 | 19 | 1400294769 source:e:\interests\ds_yan\chapter 2\textbook\linklist\main.cpp 20 | 21 | 22 | "LinkList.h" 23 | 24 | -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/Sqlist.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/LinkList.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /chapter 10/chapter 10/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "MyHeader.h" 5 | 6 | int main() { 7 | //SqList L; 8 | //CreateSqList(L, "SqList_Data.txt"); 9 | //InsertSort(L); 10 | //BInsertSort(L); 11 | //TwoInsertSort(L); 12 | //int dlta[30] = { 2, 1 }; 13 | //ShellSort(L, dlta, 2); 14 | //QuickSort(L); 15 | //SelectSort(L); 16 | //InverseSq(L); 17 | //HeapSort(L); 18 | //MergeSort(L); 19 | //ListTraverse_Sq(L, display_Sq); 20 | //DestroyList_Sq(L); 21 | /*SLinkListType SL; 22 | CreateLinkList(SL, "SqList_Data.txt"); 23 | TableInsertSort(SL); 24 | Arrange(SL); 25 | for (int i = 1; i <= SL.length; i++) { 26 | printf("%d ", SL.r[i].key); 27 | }*/ 28 | SLList L; 29 | CreateRadixSort(L, "RADIX_DATA.txt"); 30 | RadixSort(L); 31 | for (int i = L.r[0].next; i; i = L.r[i].next) { 32 | printf("%d ", L.r[i].keys[2] * 100 + L.r[i].keys[1] * 10 + L.r[i].keys[0]); 33 | } 34 | printf("\n"); 35 | system("pause"); 36 | return 0; 37 | } -------------------------------------------------------------------------------- /chapter 3/chapter 3.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chapter 3", "chapter 3.vcxproj", "{80EDEB55-C492-4313-8F43-5B27D7FDA18F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {80EDEB55-C492-4313-8F43-5B27D7FDA18F}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {80EDEB55-C492-4313-8F43-5B27D7FDA18F}.Debug|Win32.Build.0 = Debug|Win32 16 | {80EDEB55-C492-4313-8F43-5B27D7FDA18F}.Release|Win32.ActiveCfg = Release|Win32 17 | {80EDEB55-C492-4313-8F43-5B27D7FDA18F}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /chapter 4/chapter 4.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chapter 4", "chapter 4.vcxproj", "{C068C325-3D55-40D6-860E-88C573116C4E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C068C325-3D55-40D6-860E-88C573116C4E}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {C068C325-3D55-40D6-860E-88C573116C4E}.Debug|Win32.Build.0 = Debug|Win32 16 | {C068C325-3D55-40D6-860E-88C573116C4E}.Release|Win32.ActiveCfg = Release|Win32 17 | {C068C325-3D55-40D6-860E-88C573116C4E}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /chapter 5/chapter 5.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chapter 5", "chapter 5.vcxproj", "{2FBE711A-ED6A-4E96-A224-6BF757CB173B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2FBE711A-ED6A-4E96-A224-6BF757CB173B}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {2FBE711A-ED6A-4E96-A224-6BF757CB173B}.Debug|Win32.Build.0 = Debug|Win32 16 | {2FBE711A-ED6A-4E96-A224-6BF757CB173B}.Release|Win32.ActiveCfg = Release|Win32 17 | {2FBE711A-ED6A-4E96-A224-6BF757CB173B}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /chapter 6/chapter 6.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chapter 6", "chapter 6.vcxproj", "{3AB5F207-B04E-4A91-9D75-BAD119AD4063}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3AB5F207-B04E-4A91-9D75-BAD119AD4063}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {3AB5F207-B04E-4A91-9D75-BAD119AD4063}.Debug|Win32.Build.0 = Debug|Win32 16 | {3AB5F207-B04E-4A91-9D75-BAD119AD4063}.Release|Win32.ActiveCfg = Release|Win32 17 | {3AB5F207-B04E-4A91-9D75-BAD119AD4063}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /chapter 7/chapter 7.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chapter 7", "chapter 7.vcxproj", "{B7804919-3A19-4D05-B784-429C1792ABBA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B7804919-3A19-4D05-B784-429C1792ABBA}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {B7804919-3A19-4D05-B784-429C1792ABBA}.Debug|Win32.Build.0 = Debug|Win32 16 | {B7804919-3A19-4D05-B784-429C1792ABBA}.Release|Win32.ActiveCfg = Release|Win32 17 | {B7804919-3A19-4D05-B784-429C1792ABBA}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /chapter 9/chapter 9.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chapter 9", "chapter 9.vcxproj", "{885DEBE0-5F9F-4CBC-ADE7-A7535A1B83B7}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {885DEBE0-5F9F-4CBC-ADE7-A7535A1B83B7}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {885DEBE0-5F9F-4CBC-ADE7-A7535A1B83B7}.Debug|Win32.Build.0 = Debug|Win32 16 | {885DEBE0-5F9F-4CBC-ADE7-A7535A1B83B7}.Release|Win32.ActiveCfg = Release|Win32 17 | {885DEBE0-5F9F-4CBC-ADE7-A7535A1B83B7}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /chapter 10/chapter 10.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chapter 10", "chapter 10\chapter 10.vcxproj", "{DA602FB2-86F7-4003-9821-2A92EC3D6BF2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DA602FB2-86F7-4003-9821-2A92EC3D6BF2}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {DA602FB2-86F7-4003-9821-2A92EC3D6BF2}.Debug|Win32.Build.0 = Debug|Win32 16 | {DA602FB2-86F7-4003-9821-2A92EC3D6BF2}.Release|Win32.ActiveCfg = Release|Win32 17 | {DA602FB2-86F7-4003-9821-2A92EC3D6BF2}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "LinkList.h" 4 | 5 | int main() 6 | { 7 | LinkList La; 8 | InitList_L(La); 9 | ElemType e; 10 | printf("Assigment for La:\n"); 11 | CreateList_L(La,5); 12 | printf("The elements in La:\n"); 13 | ListTraverse_L(La,Display_L); 14 | ListDelete_L(La, 2, e); 15 | printf("We have deleted the 2th element in La:\n"); 16 | ListTraverse_L(La,Display_L); 17 | ListInsert_L(La, 2, e); 18 | printf("Put the element deleted in the proier statement in 2th:\n"); 19 | ListTraverse_L(La,Display_L); 20 | LinkList Lb; 21 | InitList_L(Lb); 22 | printf("Assigment for another LinkList Lb:\n"); 23 | CreateList_L(Lb,5); 24 | printf("The elements in Lb:\n"); 25 | ListTraverse_L(Lb,Display_L); 26 | LinkList Lc; 27 | InitList_L(Lc); 28 | MergeList_L(La, Lb, Lc); 29 | printf("After merging La and Lb:\n"); 30 | ListTraverse_L(Lc,Display_L); 31 | printf("The number of elements in Lb: %d\n",ListLength_L(Lc)); 32 | Destroy_L(La); 33 | Destroy_L(Lb); 34 | Destroy_L(Lc); 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/LinkList.h: -------------------------------------------------------------------------------- 1 | #ifndef LINKLIST_H_INCLUDED 2 | #define LINKLIST_H_INCLUDED 3 | 4 | #define TRUE 1 5 | #define FALSE 0 6 | #define OK 1 7 | #define ERROR 0 8 | #define INFEASIBLE -1 9 | #define OVERFLOW -2 10 | 11 | #define LIST_INIT_SIZE 100 12 | #define LISTINCREMENT 10 13 | 14 | typedef int ElemType; 15 | typedef int Status; 16 | 17 | typedef struct LNode{ 18 | ElemType data; 19 | struct LNode *next; 20 | }LNode, *LinkList; 21 | 22 | void InitList_L(LinkList &L); 23 | void Destroy_L(LinkList &L); 24 | void ClearList_L(LinkList &L); 25 | void CreateList_L(LinkList &L, int n); 26 | Status ListEmpty(LinkList L); 27 | int ListLength_L(LinkList L); 28 | Status GetElem_L(LinkList L, int i, ElemType &e); 29 | int LocateElme_L(LinkList L, ElemType e, Status (*compare)(ElemType, ElemType)); 30 | Status Equal_L(ElemType e1,ElemType e2); 31 | Status PriorElem_L(LinkList L, ElemType cur_e, ElemType &pre_e); 32 | Status NextElem_L(LinkList L, ElemType cur_e, ElemType &next_e); 33 | Status ListInsert_L(LinkList &L, int i, ElemType e); 34 | Status ListDelete_L(LinkList &L, int i, ElemType &e); 35 | void MergeList_L(LinkList &La, LinkList &Lb, LinkList &Lc); 36 | void ListTraverse_L(LinkList &L, Status(*visit)(ElemType)); 37 | Status Display_L(ElemType e); 38 | 39 | #endif // LINKLIST_H_INCLUDED 40 | -------------------------------------------------------------------------------- /chapter 5/chapter 5.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 26 | 27 | 源文件 28 | 29 | 30 | 源文件 31 | 32 | 33 | -------------------------------------------------------------------------------- /chapter 2/textbook/Sqlist/Sqlist.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 45 | 46 | -------------------------------------------------------------------------------- /chapter 2/textbook/LinkList/LinkList.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 45 | 46 | -------------------------------------------------------------------------------- /chapter 4/chapter 4.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 29 | 30 | 源文件 31 | 32 | 33 | 源文件 34 | 35 | 36 | 源文件 37 | 38 | 39 | -------------------------------------------------------------------------------- /chapter 3/chapter 3.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 35 | 36 | 源文件 37 | 38 | 39 | 源文件 40 | 41 | 42 | 源文件 43 | 44 | 45 | 源文件 46 | 47 | 48 | 源文件 49 | 50 | 51 | -------------------------------------------------------------------------------- /chapter 7/chapter 7.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 41 | 42 | 源文件 43 | 44 | 45 | 源文件 46 | 47 | 48 | 源文件 49 | 50 | 51 | 源文件 52 | 53 | 54 | 源文件 55 | 56 | 57 | -------------------------------------------------------------------------------- /chapter 9/chapter 9.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 头文件 41 | 42 | 43 | 44 | 45 | 源文件 46 | 47 | 48 | 源文件 49 | 50 | 51 | 源文件 52 | 53 | 54 | 源文件 55 | 56 | 57 | 源文件 58 | 59 | 60 | 源文件 61 | 62 | 63 | 源文件 64 | 65 | 66 | -------------------------------------------------------------------------------- /chapter 10/chapter 10/chapter 10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 头文件 41 | 42 | 43 | 44 | 45 | 源文件 46 | 47 | 48 | 源文件 49 | 50 | 51 | 源文件 52 | 53 | 54 | 源文件 55 | 56 | 57 | 源文件 58 | 59 | 60 | 源文件 61 | 62 | 63 | 头文件 64 | 65 | 66 | -------------------------------------------------------------------------------- /chapter 6/chapter 6.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 头文件 41 | 42 | 43 | 头文件 44 | 45 | 46 | 47 | 48 | 源文件 49 | 50 | 51 | 源文件 52 | 53 | 54 | 源文件 55 | 56 | 57 | 源文件 58 | 59 | 60 | 源文件 61 | 62 | 63 | 源文件 64 | 65 | 66 | 源文件 67 | 68 | 69 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | 11 | [Dd]ebug/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | [Bb]in/ 16 | [Oo]bj/ 17 | 18 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 19 | !packages/*/build/ 20 | 21 | # MSTest test Results 22 | [Tt]est[Rr]esult*/ 23 | [Bb]uild[Ll]og.* 24 | 25 | *_i.c 26 | *_p.c 27 | *.ilk 28 | *.meta 29 | *.obj 30 | *.pch 31 | *.pdb 32 | *.pgc 33 | *.pgd 34 | *.rsp 35 | *.sbr 36 | *.tlb 37 | *.tli 38 | *.tlh 39 | *.tmp 40 | *.tmp_proj 41 | *.log 42 | *.vspscc 43 | *.vssscc 44 | .builds 45 | *.pidb 46 | *.log 47 | *.scc 48 | 49 | # Visual C++ cache files 50 | ipch/ 51 | *.aps 52 | *.ncb 53 | *.opensdf 54 | *.sdf 55 | *.cachefile 56 | 57 | # Visual Studio profiler 58 | *.psess 59 | *.vsp 60 | *.vspx 61 | 62 | # Guidance Automation Toolkit 63 | *.gpState 64 | 65 | # ReSharper is a .NET coding add-in 66 | _ReSharper*/ 67 | *.[Rr]e[Ss]harper 68 | 69 | # TeamCity is a build add-in 70 | _TeamCity* 71 | 72 | # DotCover is a Code Coverage Tool 73 | *.dotCover 74 | 75 | # NCrunch 76 | *.ncrunch* 77 | .*crunch*.local.xml 78 | 79 | # Installshield output folder 80 | [Ee]xpress/ 81 | 82 | # DocProject is a documentation generator add-in 83 | DocProject/buildhelp/ 84 | DocProject/Help/*.HxT 85 | DocProject/Help/*.HxC 86 | DocProject/Help/*.hhc 87 | DocProject/Help/*.hhk 88 | DocProject/Help/*.hhp 89 | DocProject/Help/Html2 90 | DocProject/Help/html 91 | 92 | # Click-Once directory 93 | publish/ 94 | 95 | # Publish Web Output 96 | *.Publish.xml 97 | 98 | # NuGet Packages Directory 99 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 100 | #packages/ 101 | 102 | # Windows Azure Build Output 103 | csx 104 | *.build.csdef 105 | 106 | # Windows Store app package directory 107 | AppPackages/ 108 | 109 | # Others 110 | sql/ 111 | *.Cache 112 | ClientBin/ 113 | [Ss]tyle[Cc]op.* 114 | ~$* 115 | *~ 116 | *.dbmdl 117 | *.[Pp]ublish.xml 118 | *.pfx 119 | *.publishsettings 120 | 121 | # RIA/Silverlight projects 122 | Generated_Code/ 123 | 124 | # Backup & report files from converting an old project file to a newer 125 | # Visual Studio version. Backup files are not needed, because we have git ;-) 126 | _UpgradeReport_Files/ 127 | Backup*/ 128 | UpgradeLog*.XML 129 | UpgradeLog*.htm 130 | 131 | # SQL Server files 132 | App_Data/*.mdf 133 | App_Data/*.ldf 134 | 135 | 136 | #LightSwitch generated files 137 | GeneratedArtifacts/ 138 | _Pvt_Extensions/ 139 | ModelManifest.xml 140 | 141 | # ========================= 142 | # Windows detritus 143 | # ========================= 144 | 145 | # Windows image file caches 146 | Thumbs.db 147 | ehthumbs.db 148 | 149 | # Folder config file 150 | Desktop.ini 151 | 152 | # Recycle Bin used on file shares 153 | $RECYCLE.BIN/ 154 | 155 | # Mac desktop service store files 156 | .DS_Store 157 | -------------------------------------------------------------------------------- /chapter 5/chapter 5.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {2FBE711A-ED6A-4E96-A224-6BF757CB173B} 15 | chapter5 16 | 17 | 18 | 19 | Application 20 | true 21 | v120 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v120 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Level3 45 | Disabled 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | Level3 55 | MaxSpeed 56 | true 57 | true 58 | true 59 | 60 | 61 | true 62 | true 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /chapter 4/chapter 4.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {C068C325-3D55-40D6-860E-88C573116C4E} 15 | chapter4 16 | 17 | 18 | 19 | Application 20 | true 21 | v120 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v120 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Level3 45 | Disabled 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | Level3 55 | MaxSpeed 56 | true 57 | true 58 | true 59 | 60 | 61 | true 62 | true 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /chapter 3/chapter 3.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {80EDEB55-C492-4313-8F43-5B27D7FDA18F} 15 | chapter3 16 | 17 | 18 | 19 | Application 20 | true 21 | v120 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v120 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Level3 45 | Disabled 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | Level3 55 | MaxSpeed 56 | true 57 | true 58 | true 59 | 60 | 61 | true 62 | true 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /chapter 7/chapter 7.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {B7804919-3A19-4D05-B784-429C1792ABBA} 15 | chapter7 16 | 17 | 18 | 19 | Application 20 | true 21 | v120 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v120 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Level3 45 | Disabled 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | Level3 55 | MaxSpeed 56 | true 57 | true 58 | true 59 | 60 | 61 | true 62 | true 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /chapter 9/chapter 9.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {885DEBE0-5F9F-4CBC-ADE7-A7535A1B83B7} 15 | chapter9 16 | 17 | 18 | 19 | Application 20 | true 21 | v120 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v120 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Level3 45 | Disabled 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | Level3 55 | MaxSpeed 56 | true 57 | true 58 | true 59 | 60 | 61 | true 62 | true 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /chapter 10/chapter 10/chapter 10.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {DA602FB2-86F7-4003-9821-2A92EC3D6BF2} 15 | chapter10 16 | 17 | 18 | 19 | Application 20 | true 21 | v120 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v120 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Level3 45 | Disabled 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | Level3 55 | MaxSpeed 56 | true 57 | true 58 | true 59 | 60 | 61 | true 62 | true 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /chapter 6/chapter 6.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {3AB5F207-B04E-4A91-9D75-BAD119AD4063} 15 | chapter6 16 | 17 | 18 | 19 | Application 20 | true 21 | v120 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v120 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Level3 45 | Disabled 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | Level3 55 | MaxSpeed 56 | true 57 | true 58 | true 59 | 60 | 61 | true 62 | true 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | --------------------------------------------------------------------------------