├── C ├── readme.md ├── graph │ └── readme.md ├── BST.cpp ├── BiTree.cpp ├── LkList.cpp ├── SqList.cpp ├── String.cpp ├── heap.cpp ├── search.cpp ├── sort.cpp ├── LkQueue.cpp ├── LkStack.cpp ├── SqQueue.cpp ├── SqStack.cpp ├── c_string.cpp ├── hash_table.cpp ├── disjoint_set.cpp └── priority_queue.cpp ├── other ├── readme.md └── redblack_tree.pptx ├── 试题 ├── readme.md ├── 2015数据结构试卷.pdf ├── 2018数据结构试卷-A.pdf ├── 2015数据结构试卷-答案.pdf └── 2018数据结构试卷-A-答案.pdf ├── 课件pdf ├── readme.md ├── 排序.pdf ├── redblack.pptx └── BloomFilters.pptx ├── cplusplus ├── readme.md └── graph │ ├── readme.md │ └── MGraph.cpp ├── ds_code └── readme.md ├── redblack_tree.md ├── 刷题 └── partition_function.md └── README.md /C/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /other/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /试题/readme.md: -------------------------------------------------------------------------------- 1 | 试卷 2 | -------------------------------------------------------------------------------- /课件pdf/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cplusplus/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cplusplus/graph/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /C/graph/readme.md: -------------------------------------------------------------------------------- 1 | 关于Graph的代码请在数据结构课程里查看 2 | -------------------------------------------------------------------------------- /ds_code/readme.md: -------------------------------------------------------------------------------- 1 | 本文件夹提供各种刷题的解答,欢迎网友共同参与建设、提供各种刷题的思路和解答。 2 | -------------------------------------------------------------------------------- /C/BST.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/BST.cpp -------------------------------------------------------------------------------- /C/BiTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/BiTree.cpp -------------------------------------------------------------------------------- /C/LkList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/LkList.cpp -------------------------------------------------------------------------------- /C/SqList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/SqList.cpp -------------------------------------------------------------------------------- /C/String.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/String.cpp -------------------------------------------------------------------------------- /C/heap.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/heap.cpp -------------------------------------------------------------------------------- /C/search.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/search.cpp -------------------------------------------------------------------------------- /C/sort.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/sort.cpp -------------------------------------------------------------------------------- /课件pdf/排序.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/课件pdf/排序.pdf -------------------------------------------------------------------------------- /C/LkQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/LkQueue.cpp -------------------------------------------------------------------------------- /C/LkStack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/LkStack.cpp -------------------------------------------------------------------------------- /C/SqQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/SqQueue.cpp -------------------------------------------------------------------------------- /C/SqStack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/SqStack.cpp -------------------------------------------------------------------------------- /C/c_string.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/c_string.cpp -------------------------------------------------------------------------------- /C/hash_table.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/hash_table.cpp -------------------------------------------------------------------------------- /试题/2015数据结构试卷.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/试题/2015数据结构试卷.pdf -------------------------------------------------------------------------------- /C/disjoint_set.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/disjoint_set.cpp -------------------------------------------------------------------------------- /试题/2018数据结构试卷-A.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/试题/2018数据结构试卷-A.pdf -------------------------------------------------------------------------------- /课件pdf/redblack.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/课件pdf/redblack.pptx -------------------------------------------------------------------------------- /C/priority_queue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/C/priority_queue.cpp -------------------------------------------------------------------------------- /试题/2015数据结构试卷-答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/试题/2015数据结构试卷-答案.pdf -------------------------------------------------------------------------------- /试题/2018数据结构试卷-A-答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/试题/2018数据结构试卷-A-答案.pdf -------------------------------------------------------------------------------- /other/redblack_tree.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/other/redblack_tree.pptx -------------------------------------------------------------------------------- /课件pdf/BloomFilters.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/课件pdf/BloomFilters.pptx -------------------------------------------------------------------------------- /cplusplus/graph/MGraph.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdong-net/ds/HEAD/cplusplus/graph/MGraph.cpp -------------------------------------------------------------------------------- /redblack_tree.md: -------------------------------------------------------------------------------- 1 | [https://cs.lmu.edu/~ray/notes/redblacktrees/](https://cs.lmu.edu/~ray/notes/redblacktrees/) 2 | 3 | [https://algorithmtutor.com/Data-Structures/Tree/Red-Black-Trees/](https://algorithmtutor.com/Data-Structures/Tree/Red-Black-Trees/) 4 | 5 | [https://github.com/Arsenalist/Red-Black-Tree-Java-Implementation/blob/master/src/RedBlackTree.java](https://github.com/Arsenalist/Red-Black-Tree-Java-Implementation/blob/master/src/RedBlackTree.java) 6 | -------------------------------------------------------------------------------- /刷题/partition_function.md: -------------------------------------------------------------------------------- 1 | 对于一个$S_n = \left\[ {1,2,\cdots, n} \right\] $的集合,可以又很多的partition(分割),如 $S_7 = {\left\[1,2,3,4,5,6,7 \right\]}$ 的一个分割是 ${\[1,2,5\],\[3,7\],\[4,6\] }$,即 $S_7$ 被分成了3个子集。 2 | 如果依次给这些构成分割的子集相应的编号:$1、2、3、\cdots$。这样的分割实际上定义了一个函数$f:S_n\rightarrow S_n$,称为**分割函数(partition_function)**。如上面的分割可以表示成分割函数: 3 | ``` 4 | f(1)= f(2) = f(5) = 1 5 | f(3)= f(7) = 2 6 | f(4) = f(6) = 3 7 | ``` 8 | 即$S_7$的元素1,2,5被映射到集合1,$S_7$的元素3,7被映射到集合2,$S_7$的元素4,6被映射到集合3。 9 | 10 | 为了保证一个分割对应的分割函数是唯一的,可以限定: 11 | 12 | + f(1) =1 13 | + Range(f) = $S_k$,其中$k\leq n$。一个$S_n$分割可能包含$k$个子集($k=1,2,\cdots,n$)。 14 | + 对$i
18 | 19 | - 微信公众号:hwdong编程 20 | 21 |

22 | 23 | - C语言版数据结构(源代码):[https://github.com/hwdong-net/ds/tree/master/C](https://github.com/hwdong-net/ds/tree/master//C) 24 | 25 | - C++版数据结构(源代码):[https://github.com/hwdong-net/ds/tree/master/cplusplus](https://github.com/hwdong-net/ds/tree/master/cplusplus) 26 | 27 | - C++17从入门到精通(源代码):[https://github.com/hwdong-net/cplusplus17](https://github.com/hwdong-net/cplusplus17) 28 | 29 | **严禁未经作者许可拷贝内容,版权所有,侵权必究** 30 | --------------------------------------------------------------------------------