java-algorithms-implementation

repository·master·Indexed 26 days ago

https://github.com/phishman3579/java-algorithms-implementation

A comprehensive Java implementation of various algorithms and data structures. The library covers data structures (Trees, Maps, Linear Structures), mathematics and number theory, graph algorithms (Shortest Path, Spanning Trees, Flow & Matching), search and sort algorithms, and string manipulations including Manacher's and Knuth-Morris-Pratt algorithms.

Tokens
942
Snippets
0
Records
9
Agent score
39%

What's inside java-algorithms-implementation

  1. Overview of Java Algorithms and Data Structures

    master
    This repository is a collection of algorithms and data structures implemented in Java. The implementations are designed for correctness and readability rather than extreme optimization. The library covers a wide range of computer science topics including data structures, mathematics, number theory, graph theory, search algorithms, sequences, and sorting algorithms.
  2. Use StringFunctions for common string manipulations

    master

    The StringFunctions class provides various implementations for common string-based algorithms. Available operations include:

    • Reversing characters: Supports implementations using additional storage (String/StringBuilder), in-place swaps, and in-place XOR.
    • Reversing words: Supports implementations using char swaps with StringBuilder, StringTokenizer, the split() method, and in-place swaps.
    • Palindrome checks: Supports implementations using additional storage (StringBuilder) or in-place symmetric element comparisons.
    • Subsets: Find subsets of characters in a String.
    • Edit Distance: Calculates the Levenshtein distance between two strings using both Recursive and Iterative approaches.
  3. Reference of implemented Mathematics and Number algorithms

    master

    Mathematical and numerical algorithms are available in the com.jwetherell.algorithms.mathematics and com.jwetherell.algorithms.numbers packages:

    • Mathematics: Distance (Chebyshev, Euclidean), Division (various methods), Multiplication (including Fast Fourier Transform), Exponentiation, Primes (Sieve of Eratosthenes, Miller-Rabin, etc.), Permutations, Modular Arithmetic, Knapsack, Ramer Douglas Peucker.
    • Numbers: Integers (binary conversion, power of 2 checks, English conversion), Longs (binary conversion), Complex (arithmetic and polar values).
  4. Reference of implemented Graph algorithms

    master

    Graph algorithms are available in the com.jwetherell.algorithms.graph package:

    • Shortest Path: Dijkstra's, Bellman-Ford, Johnsons', Floyd-Warshall, A*.
    • Spanning Trees: Prim's, Kruskal's.
    • Traversal & Connectivity: Depth First Traversal, Breadth First Traversal, Cycle Detection, Connected Components, Topological Sort.
    • Flow & Matching: Push-Relabel, Edmonds Karp, Turbo Matching.
  5. Reference of implemented Search and Sort algorithms

    master

    Search and Sort algorithms are available in the com.jwetherell.algorithms.search and com.jwetherell.algorithms.sorts packages:

    • Search: Linear Search, Quickselect, Binary Search, Lower Bound, Upper Bound, Interpolation Search.
    • Sorts: American Flag Sort, Bubble Sort, Counting Sort, Heap Sort, Insertion Sort, Merge Sort, Quick Sort, Radix Sort, Shell's Sort.
    • Sequences: Longest Common Subsequence, Longest Increasing Subsequence, Subsequence Counter, Fibonacci Sequence, Arithmetic Progression, Largest Sum Contiguous Subarray (Kadane's), Longest Palindromic Subsequence.
  6. Reference of implemented Data Structures

    master

    The following data structures are available in the com.jwetherell.algorithms.data_structures package:

    • Trees: AVL Tree, B-Tree, Binary Search Tree, Compact Suffix Trie, Fenwick Tree (BIT), Interval Tree, Implicit Key Treap, KD Tree, Patricia Trie, Quad-Tree, Red-Black Tree, Segment Tree, Splay Tree, Suffix Array, Suffix Tree, Suffix Trie, Ternary Search Tree, Treap, Tree, Trie, Trie Map.
    • Maps/Associative Arrays: Hash Map, Hash Array Mapped Trie (HAMT), Radix Trie, TreeMap, Trie Map.
    • Linear Structures: Binary Heap, Disjoint Set, List, Matrix, Queue, Skip List, Stack, Suffix Array.
    • Other: Graph (Undirected/Directed).