1
- # data-structures-and-algorithms
1
+ # Data Structures & Algorithms
2
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
3
4
- ** Also ** , the structure of the codebase is optimised for IntelliJ IDEA since implementation are mostly written in Java.
4
+ The project uses Gradle and the structure is optimised for IntelliJ IDEA since implementation are mostly written in Java.
5
5
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. If you wish to contribute, do drop me an email at
[email protected] .
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
+
8
+ If you wish to contribute, do drop an email at
[email protected] .
7
9
8
10
## Full List of Implementation (in alphabetical order):
9
11
## Structures
@@ -12,57 +14,56 @@ This repository contains implementation of some fundamental data structures and
12
14
* Quick Find
13
15
* Weighted Union
14
16
* Path compression
15
- - [ Hashing] ( src/dataStructures/hashSet )
16
- * [ Chaining] ( src/dataStructures/hashSet/chaining/ )
17
- * [ Open Addressing] ( src/dataStructures/hashSet/openAddressing/ )
18
- - [ Heap] ( src/dataStructures/heap/ )
17
+ - [ Hashing] ( src/main/java/ dataStructures/hashSet )
18
+ * [ Chaining] ( src/main/java/ dataStructures/hashSet/chaining )
19
+ * [ Open Addressing] ( src/main/java/ dataStructures/hashSet/openAddressing )
20
+ - [ Heap] ( src/main/java/ dataStructures/heap )
19
21
* Max heap implementation
20
- - [ Linked List] ( src/dataStructures/linkedList )
22
+ - [ Linked List] ( src/main/java/ dataStructures/linkedList )
21
23
- LRU Cache
22
24
- Minimum Spanning Tree
23
- - [ Queue] ( src/dataStructures/queue )
25
+ - [ Queue] ( src/main/java/ dataStructures/queue )
24
26
- Segment Tree
25
27
* Array implementation
26
28
* TreeNode implementation
27
- - [ Stack] ( src/dataStructures/stack )
29
+ - [ Stack] ( src/main/java/ dataStructures/stack )
28
30
- Trie
29
31
30
32
31
33
## Algorithms
32
- - [ Counting Sort] ( src/algorithms/sorting/countingSort/ )
33
- - [ Cyclic Sort] ( src/algorithms/sorting/cyclicSort/ )
34
- * [ Special case] ( src/algorithms/sorting/cyclicSort/simple ) of O(n) time complexity
35
- * [ Generalized case] ( src/algorithms/sorting/cyclicSort/generalised ) of O(n^2) time complexity
36
- - [ Knuth-Morris-Pratt] ( src/algorithms/patternFinding/ ) aka KMP algorithm
37
- - [ Matrix Operations] ( others/matrix_operations/ )
38
- - [ Bubble Sort] ( src/algorithms/sorting/bubbleSort )
39
- - [ Insertion Sort] ( src/algorithms/sorting/insertionSort )
40
- - [ Selection Sort] ( src/algorithms/sorting/selectionSort )
34
+ - [ Counting Sort] ( src/main/java/algorithms/sorting/countingSort )
35
+ - [ Cyclic Sort] ( src/main/java/algorithms/sorting/cyclicSort )
36
+ * [ Special case] ( src/main/java/algorithms/sorting/cyclicSort/simple ) of O(n) time complexity
37
+ * [ 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
+ - [ Insertion Sort] ( src/main/java/algorithms/sorting/insertionSort )
41
+ - [ Selection Sort] ( src/main/java/algorithms/sorting/selectionSort )
41
42
- Merge Sort
42
- * [ Recursive] ( src/algorithms/sorting/mergeSort/recursive )
43
- * [ Bottom-up iterative] ( src/algorithms/sorting/mergeSort/iterative )
43
+ * [ Recursive] ( src/main/java/ algorithms/sorting/mergeSort/recursive )
44
+ * [ Bottom-up iterative] ( src/main/java/ algorithms/sorting/mergeSort/iterative )
44
45
- Quick Sort
45
- * [ Hoare's] ( src/algorithms/sorting/quickSort/hoares )
46
- * [ Lomuto's] ( src/algorithms/sorting/quickSort/lomuto )
47
- * [ Paranoid] ( src/algorithms/sorting/quickSort/paranoid )
48
- * [ 3-way Partitioning] ( src/algorithms/sorting/quickSort/threeWayPartitioning )
46
+ * [ Hoare's] ( src/main/java/ algorithms/sorting/quickSort/hoares )
47
+ * [ Lomuto's] ( src/main/java/ algorithms/sorting/quickSort/lomuto )
48
+ * [ Paranoid] ( src/main/java/ algorithms/sorting/quickSort/paranoid )
49
+ * [ 3-way Partitioning] ( src/main/java/ algorithms/sorting/quickSort/threeWayPartitioning )
49
50
- Radix Sort
50
51
51
52
52
53
## Short-cut to CS2040S Material
53
54
1 . Basic structures
54
- * [ Linked List] ( src/dataStructures/linkedList )
55
- * [ Stack] ( src/dataStructures/stack )
56
- * [ Queue] ( src/dataStructures/queue )
55
+ * [ Linked List] ( src/main/java/ dataStructures/linkedList )
56
+ * [ Stack] ( src/main/java/ dataStructures/stack )
57
+ * [ Queue] ( src/main/java/ dataStructures/queue )
57
58
2 . Binary Search
58
59
* Peak Finding
59
60
* Template
60
61
3 . Sorting
61
- * [ Bubble] ( src/algorithms/sorting/bubbleSort )
62
- * [ Insertion] ( src/algorithms/sorting/insertionSort )
63
- * [ Selection] ( src/algorithms/sorting/selectionSort )
64
- * [ Merge] ( src/algorithms/sorting/mergeSort )
65
- * [ Quick] ( src/algorithms/sorting/quickSort )
62
+ * [ Bubble] ( src/main/java/ algorithms/sorting/bubbleSort )
63
+ * [ Insertion] ( src/main/java/ algorithms/sorting/insertionSort )
64
+ * [ Selection] ( src/main/java/ algorithms/sorting/selectionSort )
65
+ * [ Merge] ( src/main/java/ algorithms/sorting/mergeSort )
66
+ * [ Quick] ( src/main/java/ algorithms/sorting/quickSort )
66
67
4 . Trees
67
68
* Binary search tree
68
69
* AVL-tree
@@ -71,15 +72,15 @@ This repository contains implementation of some fundamental data structures and
71
72
* Augmented tree for orthogonal range searching
72
73
* Red-Black Tree
73
74
* ab-Tree
74
- 5 . [ Binary Heap] ( src/dataStructures/heap/ )
75
+ 5 . [ Binary Heap] ( src/main/java/ dataStructures/heap )
75
76
* Max heap implementation
76
77
6 . Disjoint Set / Union Find
77
78
* Quick Find
78
79
* Weighted Union
79
80
* Path compression
80
- 7 . [ Hashing] ( src/dataStructures/hashSet )
81
- * [ Chaining] ( src/dataStructures/hashSet/chaining/ )
82
- * [ Open Addressing] ( src/dataStructures/hashSet/openAddressing/ )
81
+ 7 . [ Hashing] ( src/main/java/ dataStructures/hashSet )
82
+ * [ Chaining] ( src/main/java/ dataStructures/hashSet/chaining )
83
+ * [ Open Addressing] ( src/main/java/ dataStructures/hashSet/openAddressing )
83
84
* Double Hashing
84
85
* Bloom filter
85
86
8 . Basic graphs
@@ -94,13 +95,8 @@ This repository contains implementation of some fundamental data structures and
94
95
* Kruskal's
95
96
96
97
97
- # Contributors
98
- Andre
99
-
100
- Kai Ting
101
-
102
- Owen
103
-
104
- Chang Xian
98
+ ## Running Custom Inputs
99
+ See [ here] ( scripts/ )
105
100
106
- Yeo Shu Heng
101
+ ## Contributors
102
+ See the [ team] ( ) !
0 commit comments