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)
Description
Languages
Java
100%