Popular Algorithms in Java
Full version of library on github.
Clean and readable Java implementation for popular algorithms like sorting, searching and many more written by github user jeandersonbc.
The following topics are covered:
- Sorting algorithms: Multiple variants of quick sort, insertion sort and merge sort
- Search algorithms: Linear and Binary search algorithms
- Other: Fast implementation of power function, maximum sum sub-array, inversions.
-
Mathematics Math algorithms. "FastPower" - Computing a^b in logarithmic time -
The Inversions Problem How to count the number of inversions in a sequence of values? Given a sequence A of integers, an inversion is a pair (A[i], A[j]) such that A[i] is greater than A[j] and i is less than j for all i and j in A[1...n] -
The Maximum-Subarray Problem The Maximum-Subarray Problem Given a sequence A of N positive and negative integers, determine an i and j such that 1 <= i <= j <= N and the sum of integers in the range [i, j] is the maximum possible sum -
The Searching Problem The Searching Problem Input Sequence of n numbers A = [a1, a2, a3, an] and a value V Output An index i such that V = A[i] or NIL if V doesn't exist in A -
The Sorting Problem Implementation of various sorting algorithms. - Insertion sort - Selection sort - Merge sort - Quick sort classic - Quick sort with median - Quick sort randomized - Quick sort randomized median