Maven is the build tool that manages all of the Java code in this project.
Some of the source code written in java will depend on the algs4 library. Here are the following steps to include the algs4.jar into this project. We are building this jar from source because the bintray repository has been shutdown, preventing Maven from easily pulling an already created algs4.jar
git clone https://github.com/kevin-wayne/algs4.gitcd algs4 && mvn packagecd </path/of/this-project>mvn packagemvn install:install-file -Dfile=/path/to/algs4/target/algs4-1.0.0.0.jar -DgroupId=edu.princeton.cs -DartifactId=algs4 -Dversion=1.0.0 -Dpackaging=jar
mvn packageto compile and package.java -jar target/<name-of-file>.jarto run the compiled codemvn testto build and run tests.
CMake (version >= 3.23) is the build tool that manages all of the C++ code in this project. Code is compiled with a C++17 compiler.
Do the "cmake dance".
cmake -S. -Bbuildto create a separate build folder to isolate generate cmake build files.cmake --build build --parallel && ctest --test-dir build --parallelto compile source and run tests.
cmake -S~/workspace/algorithms -GNinja -B~/workspace/algorithms/build && cmake --build ~/workspace/algorithms/build --parallel 8 && ctest --test_dir ~/workspace/algorithms/build --parallel 8
- Install pyenv
- Use pyenv to install Python3 (e.g.
pyenv install 3.9.5) - Use the installed pip3 to install virtualenv
pip install virtualenv - Create and source virtualenv
virtualenv venv && source venv/bin/activate - Install pybuilder in virtualenv
- Call
pybto run all tests
| Topic | C++ | Java | Tests |
|---|---|---|---|
| Stacks | ✔️ | ✔️ | ✔️ |
| Queues | ✔️ | ✔️ | ✔️ |
| Bags | ✔️ | ✔️ | |
| Deque | ✔️ | ✔️ | |
| Union Find | x |
| Topic | C++ | Java | Tests |
|---|---|---|---|
| Insertion Sort | ✔️ | ✔️ | ✔️ |
| Selection Sort | ✔️ | ✔️ | ✔️ |
| ShellSort | ✔️ | ✔️ | ✔️ |
| QuickSort | ✔️ | ✔️ | ✔️ |
| MergeSort | ✔️ | ✔️ | |
| HeapSort | ✔️ | ✔️ | |
| Binary Heaps | ✔️ | ✔️ |
| Topic | C++ | Tests |
|---|---|---|
| Binary Search Trees | ✔️ | ✔️ |
| Red-Black Trees | x | |
| k-d trees | ✔️ | ✔️ |
| Separate Chaining Hash Tables | ||
| Linear Probing Hash Tables |
| Topic | C++ | Tests |
|---|---|---|
| Undirected Graph Data Structure | ✔️ | ✔️ |
| Depth-First Search | ✔️ | ✔️ |
| Connected Components | ✔️ | ✔️ |
| Breadth-First Search | ✔️ | ✔️ |
| Directed Graph Data Structure | ✔️ | ✔️ |
| Cycle Detection | ✔️ | ✔️ |
| Topological Sort | ✔️ | ✔️ |
| Kosaraju−Sharir | ✔️ | ✔️ |
| Weighted Edge Data Structure | ✔️ | ✔️ |
| Edge Weighted Graph Data Structure | ✔️ | ✔️ |
| Kruskal | ✔️ | ✔️ |
| Prim | ✔️ | ✔️ |
| Dijkstra | ✔️ | ✔️ |
| Bellman−Ford |
| Topic | C++ | Tests |
|---|---|---|
| LSD Radix Sort | ||
| MSD Radix Sort | ||
| 3-Way Radix QuickSort | ||
| Multiway Tries | ||
| Ternary Search Tries | ||
| Knuth−Morris−Pratt | ||
| Boyer−Moore | ||
| Rabin–Karp | ||
| Regular Expression Matching | ||
| Run-Length Coding | ||
| Huffman Coding | ||
| LZW Compression | ||
| Burrows−Wheeler Transform |
| Topic | C++ | Tests |
|---|---|---|
| Networking: Ford-Fulkerson |
1.1 Percolation
1.2 Deque & Randomized Queue
1.3 Collinear Points
1.4 Slider Puzzle
1.5 KdTree
2.1 WordNet
2.2 Seam Carving
2.3 Baseball Elimination
2.4 Boggle
2.5 Burrows-Wheeler
Sedgewick - Algorithms, Fourth Edition
Algorithms, Part 1 on Coursera
Algorithms, Part 2 on Coursera
Stroustrup - The C++ Programming Language, Fourth Edition
Aziz, Adnan, et al. - Elements of Programming Interviews