1
1
# Data Structures & Algorithms
2
- This repository contains implementation of some fundamental data structures and algorithms in Computer Science. It is primarily used as a teaching resource and is currently being developed by ex-2040s students.
3
2
4
- The project uses Gradle and the structure is optimised for IntelliJ IDEA since implementation are mostly written in Java.
3
+ This repository contains implementation and discussion notes (intuition, applications, analysis)
4
+ of some fundamental data structures and algorithms in Computer Science. <br >
5
+ It is aligned with [ CS2040s] ( https://nusmods.com/courses/CS2040S/data-structures-and-algorithms ) syllabus taught at NUS.
5
6
6
- ** Note** : This is still being developed. Those below with links mean that they are complete (alongside testing). We project to complete CS2040s course content by November and along the way, add interesting algorithms/problems. We are hopeful that the subsequent batches of students (from AY23/24 S2) will benefit greatly from this.
7
+ The work here is continually being developed by CS2040s Teaching Assistants(TAs) and ex-2040s students.
8
+ Lecture content has been covered and future plans include deeper discussion into the tougher parts of tutorials.
7
9
8
- If you wish to contribute, do drop an email at
[email protected] .
10
+ The project's structure is optimised for IntelliJ IDEA as per the course's preferred IDE.
11
+ Gradle is used for development.
9
12
10
- ## Full List of Implementation (in alphabetical order):
11
- ## Structures
13
+ ## Full List (in alphabetical order):
14
+
15
+ ## Data Structures
12
16
- Adelson-Velskii and Landis (AVL) Binary Search Tree
13
- - Disjoint Set / Union Find
14
- * Quick Find
15
- * Weighted Union
16
- * Path compression
17
+ - [ Disjoint Set / Union Find] ( src/main/java/dataStructures/disjointSet )
18
+ * [ Quick Find] ( src/main/java/dataStructures/disjointSet/quickFind )
19
+ * [ Weighted Union] ( src/main/java/dataStructures/disjointSet/weightedUnion )
20
+ * Path compression
17
21
- [ Hashing] ( src/main/java/dataStructures/hashSet )
18
22
* [ Chaining] ( src/main/java/dataStructures/hashSet/chaining )
19
23
* [ Open Addressing] ( src/main/java/dataStructures/hashSet/openAddressing )
20
24
- [ Heap] ( src/main/java/dataStructures/heap )
21
- * Max heap implementation
25
+ * Max heap implementation
22
26
- [ Linked List] ( src/main/java/dataStructures/linkedList )
23
27
- LRU Cache
24
28
- Minimum Spanning Tree
29
+ * Kruskal
30
+ * Prim's
31
+ * Boruvska
25
32
- [ Queue] ( src/main/java/dataStructures/queue )
33
+ - [ Deque] ( src/main/java/dataStructures/queue/Deque )
34
+ - [ Monotonic Queue] ( src/main/java/dataStructures/queue/monotonicQueue )
26
35
- Segment Tree
27
- * Array implementation
28
- * TreeNode implementation
29
36
- [ Stack] ( src/main/java/dataStructures/stack )
30
- - Trie
31
-
37
+ - [ Trie] ( src/main/java/dataStructures/trie )
32
38
33
39
## Algorithms
40
+ - [ Bubble Sort] ( src/main/java/algorithms/sorting/bubbleSort )
41
+ - [ Binary Search] ( src/main/java/algorithms/binarySearch )
42
+ * [ Template] ( src/main/java/algorithms/binarySearch/binarySearchTemplated )
34
43
- [ Counting Sort] ( src/main/java/algorithms/sorting/countingSort )
35
44
- [ Cyclic Sort] ( src/main/java/algorithms/sorting/cyclicSort )
36
45
* [ Special case] ( src/main/java/algorithms/sorting/cyclicSort/simple ) of O(n) time complexity
37
46
* [ Generalized case] ( src/main/java/algorithms/sorting/cyclicSort/generalised ) of O(n^2) time complexity
38
- - [ Knuth-Morris-Pratt] ( src/main/java/algorithms/patternFinding ) aka KMP algorithm
39
- - [ Bubble Sort] ( src/main/java/algorithms/sorting/bubbleSort )
40
47
- [ Insertion Sort] ( src/main/java/algorithms/sorting/insertionSort )
41
- - [ Selection Sort ] ( src/main/java/algorithms/sorting/selectionSort )
48
+ - [ Knuth-Morris-Pratt ] ( src/main/java/algorithms/patternFinding ) aka KMP algorithm
42
49
- Merge Sort
43
50
* [ Recursive] ( src/main/java/algorithms/sorting/mergeSort/recursive )
44
51
* [ Bottom-up iterative] ( src/main/java/algorithms/sorting/mergeSort/iterative )
@@ -47,56 +54,68 @@ If you wish to contribute, do drop an email at
[email protected] .
47
54
* [ Lomuto's] ( src/main/java/algorithms/sorting/quickSort/lomuto )
48
55
* [ Paranoid] ( src/main/java/algorithms/sorting/quickSort/paranoid )
49
56
* [ 3-way Partitioning] ( src/main/java/algorithms/sorting/quickSort/threeWayPartitioning )
50
- - Radix Sort
51
-
57
+ - [ Radix Sort] ( src/main/java/algorithms/sorting/radixSort )
58
+ - [ Selection Sort ] ( src/main/java/algorithms/sorting/selectionSort )
52
59
53
- ## Short-cut to CS2040S Material
60
+ ## CS2040S Syllabus (in rough order)
54
61
1 . Basic structures
55
62
* [ Linked List] ( src/main/java/dataStructures/linkedList )
56
63
* [ Stack] ( src/main/java/dataStructures/stack )
57
64
* [ Queue] ( src/main/java/dataStructures/queue )
58
65
2 . [ Binary Search] ( src/main/java/algorithms/binarySearch )
59
66
* Peak Finding
60
- * Template
67
+ * [ Template] ( src/main/java/algorithms/binarySearch/binarySearchTemplated )
61
68
3 . Sorting
62
69
* [ Bubble] ( src/main/java/algorithms/sorting/bubbleSort )
63
70
* [ Insertion] ( src/main/java/algorithms/sorting/insertionSort )
64
71
* [ Selection] ( src/main/java/algorithms/sorting/selectionSort )
65
72
* [ Merge] ( src/main/java/algorithms/sorting/mergeSort )
66
73
* [ Quick] ( src/main/java/algorithms/sorting/quickSort )
74
+ * [ Hoare's] ( src/main/java/algorithms/sorting/quickSort/hoares )
75
+ * [ Lomuto's] ( src/main/java/algorithms/sorting/quickSort/lomuto ) (Not discussed in CS2040s)
76
+ * [ Paranoid] ( src/main/java/algorithms/sorting/quickSort/paranoid )
77
+ * [ 3-way Partitioning] ( src/main/java/algorithms/sorting/quickSort/threeWayPartitioning )
78
+ * [ Counting Sort] ( src/main/java/algorithms/sorting/countingSort ) (found in tutorial)
79
+ * [ Radix Sort] ( src/main/java/algorithms/sorting/radixSort ) (found in tutorial)
67
80
4 . Trees
68
81
* [ Binary search tree] ( src/main/java/dataStructures/binarySearchTree )
69
82
* AVL-tree
70
- * Kd-tree
71
- * Interval tree
72
- * Augmented tree for orthogonal range searching
73
- * Red-Black Tree
74
- * ab-Tree
75
- 5 . [ Binary Heap] ( src/main/java/dataStructures/heap )
76
- * Max heap implementation
77
- 6 . Disjoint Set / Union Find
78
- * Quick Find
79
- * Weighted Union
80
- * Path compression
83
+ * Orthogonal Range Searching
84
+ * [ Trie] ( src/main/java/dataStructures/trie )
85
+ * B-Tree
86
+ * Red-Black Tree (Not covered in CS2040s but useful!)
87
+ * Kd-tree (** WIP** )
88
+ * Interval tree (** WIP** )
89
+ 5 . [ Binary Heap] ( src/main/java/dataStructures/heap ) (Max heap)
90
+ 6 . [ Disjoint Set / Union Find] ( src/main/java/dataStructures/disjointSet )
91
+ * [ Quick Find] ( src/main/java/dataStructures/disjointSet/quickFind )
92
+ * [ Weighted Union] ( src/main/java/dataStructures/disjointSet/weightedUnion ) (with path compression)
81
93
7 . [ Hashing] ( src/main/java/dataStructures/hashSet )
82
94
* [ Chaining] ( src/main/java/dataStructures/hashSet/chaining )
83
95
* [ Open Addressing] ( src/main/java/dataStructures/hashSet/openAddressing )
84
- * Double Hashing
85
- * Bloom filter
86
- 8 . Basic graphs
96
+ * Bloom filter (** WIP** )
97
+ 8 . Basic graphs (** WIP** )
87
98
* Depth-first search
88
99
* Breadth-first search
89
100
9 . Graphs
90
101
* Bellman-ford
91
102
* Dijkstra
92
- * Directed acyclic graphs
103
+ * Directed acyclic graphs algorithms (** WIP** )
104
+ * Post-order DFS
105
+ * Kahn's
106
+ * Floyd Warshall (** WIP** )
93
107
10 . Minimum spanning tree
94
- * Prim's
108
+ * Prim's
95
109
* Kruskal's
96
110
97
-
98
111
## Running Custom Inputs
99
112
See [ here] ( scripts/README.md ) .
100
113
114
+ ## Disclaimer
115
+ While our team of TAs and students have diligently verified the correctness of our code, there might still be
116
+ some discrepancies or deviation from lecture content (perhaps due to new changes).
117
+ In which case, ** you are strongly advised to raise it up to us or consult your TA** regarding any suspicions
118
+ on the use of the information shared here.
119
+
101
120
## Contributors
102
121
See the [ team] ( docs/team/profiles.md ) !
0 commit comments