Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gzc/CLRS
:notebook:Solutions to Introduction to Algorithms
https://github.com/gzc/CLRS
Last synced: 15 days ago
JSON representation
:notebook:Solutions to Introduction to Algorithms
- Host: GitHub
- URL: https://github.com/gzc/CLRS
- Owner: gzc
- License: mit
- Created: 2013-12-03T08:07:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2023-10-15T21:44:54.000Z (about 1 year ago)
- Last Synced: 2024-10-15T12:42:10.424Z (26 days ago)
- Language: C++
- Homepage:
- Size: 11.7 MB
- Stars: 9,463
- Watchers: 380
- Forks: 2,753
- Open Issues: 84
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-AI-algorithm - Github
README
# Solutions to CLRS.
Solutions to *Introduction to Algorithms* by Charles E. Leiserson, Clifford Stein, Ronald Rivest, and Thomas H. Cormen (CLRS).![](https://images-na.ssl-images-amazon.com/images/I/51n%2B3GEQvYL._SX433_BO1,204,203,200_.jpg)
## Contributor
1. [Soyn](https://github.com/Soyn)
2. [idf](https://github.com/idf)
3. [W4anD0eR96](https://github.com/W4anD0eR96)
4. [knight42](https://github.com/knight42)
5. [ajinkyakolhe112](https://github.com/ajinkyakolhe112)
6. [an-yun](https://github.com/an-yun)
7. [y1y](https://github.com/y1y)
8. [RepapLataf](https://github.com/RepapLataf)
9. [Ghost---Shadow](https://github.com/Ghost---Shadow)
10. [wonjunetai](https://github.com/wonjunetai)
11. [suensky](https://github.com/suensky)
12. [xwu64](https://github.com/xwu64)
13. [ryuxin](https://github.com/ryuxin)
14. [Puriney](https://github.com/Puriney)
15. [wild-flame](https://github.com/wild-flame)
16. [zhangysh1995](https://github.com/zhangysh1995)
17. [DarthUjj](https://github.com/DarthUjj)
18. [VMatrix1900](https://github.com/VMatrix1900)
19. [Jingru](https://github.com/Jingru)
20. [prasook-jain](https://github.com/prasook-jain)
21. [Mundhey](https://github.com/Mundhey)
22. [Cokile](https://github.com/Cokile)
23. [wuchichung](https://github.com/wuchichung)
24. [saurabhvyas](https://github.com/saurabhvyas)
25. [codemukul95](https://github.com/codemukul95)
26. [JasonQSY](https://github.com/JasonQSY)
27. [imbrobits](https://github.com/imbrobits)
28. [zhanglanqing](https://github.com/zhanglanqing)
29. [tushar-rishav](https://github.com/tushar-rishav)
30. [ravgill](https://github.com/ravgill)
31. [Mad_Kingu](https://github.com/Mad-Kingu)
32. [kotoz](https://github.com/Kottoz)If I miss your name here, please pull a request to me to fix.
You maybe interested in another repo [gitstats](https://github.com/gzc/gitstats) which generates repo contribution of CLRS.
## This repo needs your help.
If you are interested in this project, you could complete problems which are marked **"UNSOLVED"** in the following list. Or if you are interested in certain chapters that have not been completed, you could fork this project and issue a pull request to this repo. Appreciate your efforts.如果你感兴趣,可以完成没有完成的题(下面有个UNSOLVED列表),或者如果你对某章节感兴趣想要完成,可以fork这个项目然后pull request进这个repo。
In order to speed up this project, we will ignore any hard problems (for instance, problems in the very end of each chapter) and review them when finishing mediocre problems. Moreover, we will only focus on sections that are interesting. You could also help to finish these hard problems.
If a problem is too easy to solve, we'll mark it as **straightforward** in order to speed up the progress.
***
Chapter
Section
Part I: Foundations
I
1
2
p
II
1
2
3
p
III
1
2
p
IV
1
2
3
4
p
V
1
2
3
4
p
Part II: Sorting and Order Statistics
VI
1
2
3
4
5
p
VII
1
2
3
4
p
VIII
1
2
3
4
p
IX
1
2
3
p
Part III: Data Structures
X
1
2
3
4
p
XI
1
2
3
4
5
p
XII
1
2
3
XIII
1
2
3
4
p
XIV
1
2
3
p
Part IV: Advanced Design and Analysis Techniques
XV
1
2
3
4
5
XVI
1
2
3
XVII
1
2
Part V: Advanced Data Structures
XVIII
1
2
3
XIX
1
2
XXI
1
2
3
Part VI: Graph Algorithms
XXII
1
2
3
4
5
p
XXIII
1
2
XXIV
1
2
3
4
XXV
1
2
3
XXVI
1
2
3
Part VII: Selected Topics
XXXI
1
2
XXXII
1
2
3
4
XXXIII
1
XXXV
1
***
## Data Structure&algorithm implementation
### BASIC
* [Heap](./C06-Heapsort/heap.cpp)
* [Priority Queue](./C06-Heapsort/p_queue.h)
* [Quicksort](./C07-Quicksort/quicksort.py)
* [Radixsort](./C08-Sorting-in-Linear-Time/exercise_code/radixSort.cpp)
* [Counting Sort](./C08-Sorting-in-Linear-Time/exercise_code/in_place_counting_sort.py)
* [K-th Finding](./C09-Medians-and-Order-Statistics/worst-case-linear-time.cpp)
* [Deque(py)](./C10-Elementary-Data-Structures/exercise_code/deque.py) [Deque(c++)](./C10-Elementary-Data-Structures/exercise_code/deque.cpp)### DIVIDE and CONQUER
* [Karatsuba](./other/Karatsuba)### TREE/ADVANCED
* [BST](./C12-Binary-Search-Trees/BSTree.h)
* [RBT](./C13-Red-Black-Trees/rbtree.cpp)
* [Btree](./C18-B-Trees/btree.cpp)
* [BinomialHeap](./C19-Binomial-Heaps/BinomialHeap.h) [Driver](././C19-Binomial-Heaps/Main.cpp)
* [SegmentTree](./other/segmentTree.cpp)
* [Trie](./other/trie.cpp)
* [UnionFind](./C21-Data-Structures-for-Disjoint-Sets/uf.cpp)### DYNAMIC/GREEDY
* [Matrix Chain](./C15-Dynamic-Programming/Matrix-chain-multiplication.c)
* [Huffman](./C16-Greedy-Algorithms/huffman)### GRAPH
* [Kosaraju's Algorithm ( strongly connected components )](./C22-Elementary-Graph-Algorithms/elementary_graph_algo.py#L70)
* [Maximum Flow](./C26-Flow-networks/maxflow)
* [Floyd-Warshall](./C25-All-Pairs-Shortest-Paths/Floyd_Warshall.cpp)### GEOMETRY
* [LineIntersection](./C33-Computational-Geometry/twoline.cpp)
* Convex Hull
* [Graham Scan](./C33-Computational-Geometry/Graham_Scan.py)### STRING
* [BruteForce](./C32-String-Matching/BF.c)
* [KMP](./C32-String-Matching/KMP.c)
* [DFA](./C32-String-Matching/FA.c)### UTILITY
* [Split string by delimiter in C++](./other/stringSpilit.cpp)# UNSOLVED
[31.1.11](./C31-Number-Theoretic-Algorithms/31.1.md#exercises-311-11)
[31.2.7](./C31-Number-Theoretic-Algorithms/31.2.md#exercises-312-7)
[31.2.9](./C31-Number-Theoretic-Algorithms/31.2.md#exercises-312-9)[32.2.4](./C32-String-Matching/32.2.md#exercises-322-4)
[32.3.4](./C32-String-Matching/32.3.md#exercises-323-4-)
[32.4.6](./C32-String-Matching/32.4.md#exercises-324-6-)***
Follow [@louis1992](https://github.com/gzc) on github to help finish this task.
You can also subscribe my [youtube channel](https://www.youtube.com/channel/UCAvvkYnRNyObcHzOCaVgSrQ).**Disclaimer**: the solutions in this repository are crowdsourced work, and in any form it neither represents any opinion of nor affiliates to the authors of Introduction to Algorithms or the MIT press.