These are some Java codes I wrote throughout my BCompSci.
.gitignore | ||
bfs_scc.java | ||
bfs_shortest_path.java | ||
collections_count_if.java | ||
Couple.java | ||
DFS.java | ||
DirectedMultiGraph.java | ||
DirectedWeightedGraph.java | ||
FastPrint.java | ||
FastScanner.java | ||
FloydWarshall.java | ||
InsertSort.java | ||
Johnson.java | ||
knapsack.java | ||
LICENSE | ||
LIS.java | ||
minimum_gap_schedulling.java | ||
README.md | ||
SegmentTree.java | ||
ValueThenKeyComparator.java |
JavaAlgorithms
These are some Java code I wrote throughout my first degree in Computer Science. There is some third party code properly credited and with its associated license.
Files Descriptions
Code I wrote
- Directed MultiGraph - Adjacency-list non-weighted directed multi-graphs (data structure)
- Directed Weighted Graph - Adjacency-list n-weighted directed graphs (data structure)
- Dijkstra - Adjacency-list Dijkstra's algorithm implementation (SSC non-negative weights only)
- Prim - Adjacency-list Prim's algorithm implementation (MST)
- Bellman-Ford - Adjacency-list Bellman-ford (SSC)
- Floyd Warshall - Adjacency-matrix Floyd Warshall (APSP)
- Johnson - Johnson's Algorithm (sparse graph APSP)
- Insert Sort - An Insertion Sort implementation (sorting)
- DFS and Topological Sorting - Adjacency-list DFS with TopSort implementation (graph traversal and sorting)
- Kosaraju-Sharir - Adjacency-list Kosaraju-Sharir implementation (SCC)
- BFS non-directed SCC - Adjacency-list BFS implementation to identify SCC in a non-directed graph (graph traversal and SCC non-directed only)
- BFS non-weighted SSC - Adjacency-list BFS for shortest path in a non-weighted graph (SSC non-weighted)
- LIS - A Longest Increasing Sequence algorithm implmentation (substring)
- Collections Count If - Counts elements for which predicate p returns true (collection utility)
Third party code
- Couple - A AOSP class to handle 2-tuples
- Segment Tree - A Segment Tree data structure implementation derived from Segewick and Wayne's Algorithms, 4th ed. book
- ValueThenKeyComparator - A Comparator that sorts Map.Entry objects with Comparable keys and values, first by value, then by key
- FastScanner - Fast Input from STDIN in Java
- FastPrint - Fast Output from STDOUT in Java
Example code
- Activity Minimum Gap Schedulling - Activity Minimum Gap Schedulling implementation (sorting)
- Knapsack - Knapsack approximation solution using conditional binary search (search and optimization)