Skip to content

Commit 0cb7e2a

Browse files
committed
merging
2 parents bc6dd57 + d55074b commit 0cb7e2a

File tree

149 files changed

+6189
-6151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+6189
-6151
lines changed

.github/workflows/gradle.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Java CI with Gradle
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: '11'
23+
distribution: 'temurin'
24+
- name: Build with Gradle
25+
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
26+
with:
27+
arguments: build --no-daemon

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
.gradle
1010

1111
# Ignore Gradle build output directory
12-
build
12+
build/

README.md

Lines changed: 58 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,51 @@
11
# 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.
32

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.
56

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.
79

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.
912

10-
## Full List of Implementation (in alphabetical order):
11-
## Structures
13+
## Full List (in alphabetical order):
14+
15+
## Data Structures
1216
- 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
1721
- [Hashing](src/main/java/dataStructures/hashSet)
1822
* [Chaining](src/main/java/dataStructures/hashSet/chaining)
1923
* [Open Addressing](src/main/java/dataStructures/hashSet/openAddressing)
2024
- [Heap](src/main/java/dataStructures/heap)
21-
* Max heap implementation
25+
* Max heap implementation
2226
- [Linked List](src/main/java/dataStructures/linkedList)
2327
- LRU Cache
2428
- Minimum Spanning Tree
29+
* Kruskal
30+
* Prim's
31+
* Boruvska
2532
- [Queue](src/main/java/dataStructures/queue)
33+
- [Deque](src/main/java/dataStructures/queue/Deque)
34+
- [Monotonic Queue](src/main/java/dataStructures/queue/monotonicQueue)
2635
- Segment Tree
27-
* Array implementation
28-
* TreeNode implementation
2936
- [Stack](src/main/java/dataStructures/stack)
30-
- Trie
31-
37+
- [Trie](src/main/java/dataStructures/trie)
3238

3339
## 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)
3443
- [Counting Sort](src/main/java/algorithms/sorting/countingSort)
3544
- [Cyclic Sort](src/main/java/algorithms/sorting/cyclicSort)
3645
* [Special case](src/main/java/algorithms/sorting/cyclicSort/simple) of O(n) time complexity
3746
* [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)
4047
- [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
4249
- Merge Sort
4350
* [Recursive](src/main/java/algorithms/sorting/mergeSort/recursive)
4451
* [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].
4754
* [Lomuto's](src/main/java/algorithms/sorting/quickSort/lomuto)
4855
* [Paranoid](src/main/java/algorithms/sorting/quickSort/paranoid)
4956
* [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)
5259

53-
## Short-cut to CS2040S Material
60+
## CS2040S Syllabus (in rough order)
5461
1. Basic structures
5562
* [Linked List](src/main/java/dataStructures/linkedList)
5663
* [Stack](src/main/java/dataStructures/stack)
5764
* [Queue](src/main/java/dataStructures/queue)
5865
2. [Binary Search](src/main/java/algorithms/binarySearch)
5966
* Peak Finding
60-
* Template
67+
* [Template](src/main/java/algorithms/binarySearch/binarySearchTemplated)
6168
3. Sorting
6269
* [Bubble](src/main/java/algorithms/sorting/bubbleSort)
6370
* [Insertion](src/main/java/algorithms/sorting/insertionSort)
6471
* [Selection](src/main/java/algorithms/sorting/selectionSort)
6572
* [Merge](src/main/java/algorithms/sorting/mergeSort)
6673
* [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)
6780
4. Trees
6881
* [Binary search tree](src/main/java/dataStructures/binarySearchTree)
6982
* 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)
8193
7. [Hashing](src/main/java/dataStructures/hashSet)
8294
* [Chaining](src/main/java/dataStructures/hashSet/chaining)
8395
* [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**)
8798
* Depth-first search
8899
* Breadth-first search
89100
9. Graphs
90101
* Bellman-ford
91102
* Dijkstra
92-
* Directed acyclic graphs
103+
* Directed acyclic graphs algorithms (**WIP**)
104+
* Post-order DFS
105+
* Kahn's
106+
* Floyd Warshall (**WIP**)
93107
10. Minimum spanning tree
94-
* Prim's
108+
* Prim's
95109
* Kruskal's
96110

97-
98111
## Running Custom Inputs
99112
See [here](scripts/README.md).
100113

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+
101120
## Contributors
102121
See the [team](docs/team/profiles.md)!

0 commit comments

Comments
 (0)