Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dzimiks/algorithms
Implementation of various algorithms and data structures written in Java.
https://github.com/dzimiks/algorithms
algorithm java
Last synced: 14 days ago
JSON representation
Implementation of various algorithms and data structures written in Java.
- Host: GitHub
- URL: https://github.com/dzimiks/algorithms
- Owner: dzimiks
- License: gpl-3.0
- Created: 2017-12-09T17:08:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-30T23:13:08.000Z (almost 7 years ago)
- Last Synced: 2024-11-09T05:38:11.428Z (2 months ago)
- Topics: algorithm, java
- Language: Java
- Homepage:
- Size: 224 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Algorithms and Data Structures
Implementation of various algorithms and data structures written in Java.
* [Algorithms](#algorithms)
* [Data Structures](#data-structures)
* [Tests](#tests)# Algorithms
| Subdomain | Code | Test Class |
|:---------:|:---------:|:--------:|
| Digraph Traversals | [DepthFirstOrder.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/digraphTraversals/DepthFirstOrder.java) | [MainDigraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainDigraphTraversals.java#L84-L113) |
| Digraph Traversals | [DirectedBFS.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/digraphTraversals/DirectedBFS.java) | [MainDigraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainDigraphTraversals.java#L53-L58) |
| Digraph Traversals | [DirectedBFSPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/digraphTraversals/DirectedBFSPaths.java) | [MainDigraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainDigraphTraversals.java#L60-L82) |
| Digraph Traversals | [DirectedDFS.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/digraphTraversals/DirectedDFS.java) | [MainDigraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainDigraphTraversals.java#L21-L26) |
| Digraph Traversals | [DirectedDFSPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/digraphTraversals/DirectedDFSPaths.java) | [MainDigraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainDigraphTraversals.java#L30-L51) |
| Graph Traversals | [AllPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/graphTraversals/AllPaths.java) | [MainGraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainGraphTraversals.java#L98-L101) |
| Graph Traversals | [BFS.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/graphTraversals/BFS.java) | [MainGraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainGraphTraversals.java#L68-L72) |
| Graph Traversals | [BFSPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/graphTraversals/BFSPaths.java) | [MainGraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainGraphTraversals.java#L74-L96) |
| Graph Traversals | [DFS.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/graphTraversals/DFS.java) | [MainGraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainGraphTraversals.java#L30-L42) |
| Graph Traversals | [DFSPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/graphTraversals/DFSPaths.java) | [MainGraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainGraphTraversals.java#L44-L66) |
| Graph Traversals | [TopologicalSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/graphTraversals/TopologicalSort.java) | [MainGraphTraversals.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainGraphTraversals.java#L22-L28) |
| Minimum Spanning Tree | [DisjointSet.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/DisjointSet.java) | [KruskalMST.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/KruskalMST.java#L45-L58) |
| Minimum Spanning Tree | [Kruskal.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/Kruskal.java) | [Kruskal.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/Kruskal.java) |
| Minimum Spanning Tree | [KruskalMST.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/KruskalMST.java) | [MainMST.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainMST.java#L42-L61) |
| Minimum Spanning Tree | [Prim.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/Prim.java) | [Prim.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/Prim.java) |
| Minimum Spanning Tree | [PrimMST.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/PrimMST.java) | [MainMST.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainMST.java#L29-L39) |
| Minimum Spanning Tree | [TarjanStronglyConnectedComponents.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/TarjanStronglyConnectedComponents.java) | [MainMST.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainMST.java#L65-L85) |
| Minimum Spanning Tree | [UnionFind.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/UnionFind.java) | [Kruskal.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/mst/Kruskal.java#L35-L47) |
| Searching | [BinarySearch.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/searching/BinarySearch.java) | [MainSearching.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSearching.java) |
| Searching / Hashing | [DoubleHashing.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/searching/hashing/DoubleHashing.java) | [MainHashing.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainHashing.java) |
| Searching / Hashing | [HashTable.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/searching/hashing/HashTable.java) | [MainHashing.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainHashing.java) |
| Shortest Paths | [BellmanFord.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/BellmanFord.java) | [MainShortestPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainShortestPaths.java#L30-L44) |
| Shortest Paths | [BellmanFordSP.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/BellmanFordSP.java) | [BellmanFordSP.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/BellmanFordSP.java) |
| Shortest Paths | [Dijkstra.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/Dijkstra.java) | [MainShortestPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainShortestPaths.java#L25-L28) |
| Shortest Paths | [DijkstraAllPairsSP.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/DijkstraAllPairsSP.java) | [MainShortestPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainShortestPaths.java) |
| Shortest Paths | [DijkstraSP.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/DijkstraSP.java) | [DijkstraSP.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/DijkstraSP.java) |
| Shortest Paths | [FloydWarshall.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/FloydWarshall.java) | [MainShortestPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainShortestPaths.java#L57-L65) |
| Shortest Paths | [FloydWarshallSP.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/FloydWarshallSP.java) | [MainShortestPaths.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainShortestPaths.java) |
| Sorting | [BubbleSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/BubbleSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |
| Sorting | [CountingSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/CountingSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |
| Sorting | [HeapSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/HeapSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |
| Sorting | [InsertionSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/InsertionSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |
| Sorting | [MergeSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/MergeSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |
| Sorting | [QuickSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/QuickSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |
| Sorting | [RadixSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/RadixSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |
| Sorting | [SelectionSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/SelectionSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |
| Sorting | [ShellSort.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/sorting/ShellSort.java) | [MainSorting.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/MainSorting.java) |# Data Structures
| Subdomain | Code | Test Class |
|:---------:|:---------:|:--------:|
| Binary Trees | [BinaryTree.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/binaryTrees/BinaryTree.java) | [MainBinaryTree.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainBinaryTree.java) |
| Binary Trees | [BinarySearchTree.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/binaryTrees/BinarySearchTree.java) | [MainBST.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainBST.java) |
| Binary Trees / AVL | [AVLTree.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/binaryTrees/AVL/AVLTree.java) | [MainAVLTree.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainAVLTree.java) |
| Digraphs | [AdjMatrixEdgeWeightedDigraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/digraphs/AdjMatrixEdgeWeightedDigraph.java) | [MainDigraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainDigraph.java#L38-L46) |
| Digraphs | [Digraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/digraphs/Digraph.java) | [MainDigraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainDigraph.java#L17-L25) |
| Digraphs | [DirectedEdge.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/digraphs/DirectedEdge.java) | [MainDigraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainDigraph.java) |
| Digraphs | [EdgeWeightedDigraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/digraphs/EdgeWeightedDigraph.java) | [MainDigraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainDigraph.java#L27-L36) |
| Digraphs | [EdgeWeightedDirectedCycle.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/digraphs/EdgeWeightedDirectedCycle.java) | [BellmanFordSP.java](https://github.com/dzimiks/Algorithms/blob/master/src/algorithms/shortestPaths/BellmanFordSP.java#L111-L112) |
| Graphs | [AdjMatrixGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/graphs/AdjMatrixGraph.java) | [MainGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainGraph.java#L28-L35) |
| Graphs | [Biconnected.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/graphs/Biconnected.java) | [MainGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainGraph.java#L84-L90) |
| Graphs | [Bridge.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/graphs/Bridge.java) | [MainGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainGraph.java#L68-L71) |
| Graphs | [ConnectedComponents.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/graphs/ConnectedComponents.java) | [MainGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainGraph.java#L51-L66) |
| Graphs | [Cycle.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/graphs/Cycle.java) | [MainGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainGraph.java#L73-L82) |
| Graphs | [Edge.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/graphs/Edge.java) | [MainGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainGraph.java#L37-L42) |
| Graphs | [EdgeWeightedGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/graphs/EdgeWeightedGraph.java) | [MainGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainGraph.java#L37-L42) |
| Graphs | [Graph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/graphs/Graph.java) | [MainGraph.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainGraph.java#L18-L20) |
| Heaps | [IndexMaxPriorityQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/heaps/IndexMaxPriorityQueue.java) | [MainHeap.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainHeap.java#L65-L74) |
| Heaps | [IndexMinPriorityQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/heaps/IndexMinPriorityQueue.java) | [MainHeap.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainHeap.java#L92-L101) |
| Heaps | [MaxHeap.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/heaps/MaxHeap.java) | [MainHeap.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainHeap.java#L17-L27) |
| Heaps | [MaxPriorityQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/heaps/MaxPriorityQueue.java) | [MainHeap.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainHeap.java#L49-L63) |
| Heaps | [MinHeap.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/heaps/MinHeap.java) | [MainHeap.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainHeap.java#L29-L39) |
| Heaps | [MinPriorityQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/heaps/MinPriorityQueue.java) | [MainHeap.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainHeap.java#L76-L90) |
| Lists | [DoubleLinkedList.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/lists/DoubleLinkedList.java) | [MainDoubleLinkedList.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainDoubleLinkedList.java) |
| Lists | [LinkedList.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/lists/LinkedList.java) | [MainLinkedList.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainLinkedList.java) |
| Lists | [SortedLinkedList.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/lists/SortedLinkedList.java) | [MainLinkedList.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainLinkedList.java) |
| Queues | [Deque.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/queues/Deque.java) | [MainDeque.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainDeque.java) |
| Queues | [LinkedPriorityQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/queues/LinkedPriorityQueue.java) | [MainQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainQueue.java#L51-L56) |
| Queues | [LinkedQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/queues/LinkedQueue.java) | [MainQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainQueue.java#L30-L37) |
| Queues | [PriorityQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/queues/PriorityQueue.java) | [MainQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainQueue.java) |
| Queues | [Queue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/queues/Queue.java) | [MainQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainQueue.java) |
| Queues | [QueueArray.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/queues/QueueArray.java) | [MainQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainQueue.java#L17-L23) |
| Queues | [QueueFromTwoStacks.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/queues/QueueFromTwoStacks.java) | [MainQueue.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainQueue.java#L43-L49) |
| Stacks | [LinkedStack.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/stacks/LinkedStack.java) | [MainStack.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainStack.java#L23-L28) |
| Stacks | [Stack.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/stacks/Stack.java) | [MainStack.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainStack.java) |
| Stacks | [StackArray.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/stacks/StackArray.java) | [MainStack.java](https://github.com/dzimiks/Algorithms/blob/master/src/dataStructures/MainStack.java#L13-L21) |# Tests
| File | Description |
|:----:|:-----------:|
| [small-graph.txt](https://github.com/dzimiks/Algorithms/blob/master/src/tests/small-graph.txt) | Small size input for Graph |
| [medium-graph.txt](https://github.com/dzimiks/Algorithms/blob/master/src/tests/medium-graph.txt) | Medium size input for Graph |
| [small-ewg.txt](https://github.com/dzimiks/Algorithms/blob/master/src/tests/small-ewg.txt) | Small size input for Edge Weighted Graph |
| [small-digraph.txt](https://github.com/dzimiks/Algorithms/blob/master/src/tests/small-digraph.txt) | Small size input for Digraph |
| [small-ewd.txt](https://github.com/dzimiks/Algorithms/blob/master/src/tests/small-ewd.txt) | Small size input for Edge Weighted Digraph |
| [small-uf.txt](https://github.com/dzimiks/Algorithms/blob/master/src/tests/small-uf.txt) | Small size input for Union Find (Disjoint Sets) |
| [medium-uf.txt](https://github.com/dzimiks/Algorithms/blob/master/src/tests/medium-uf.txt) | Medium size input for Union Find (Disjoint Sets) |