kotlin-algorithm-club icon indicating copy to clipboard operation
kotlin-algorithm-club copied to clipboard

Algorithms and data structures in Kotlin.

alt text

Kotlin License codebeat badge

Here you can find the most common algorithms and data structures written in Kotlin.

The goal of this project is to create the most eloquent implementations of old algorithms in the new language. The code is meant to be as self-describing as possible, so I do not plan to include much documentation. It is assumed that you know the basics; if you want to learn algorithms perhaps it is a wrong place. I do full-heartedly recommend The Algorithm Design Manual by Steven Skiena and of course...

Algorithms, 4th Edition

This project is inspired by and based on wonderful works of Robert Sedgewick and Kevin Wayne. Most of the implementations were taken from the algs4 library.

List of the algorithms

Sorting
  • Insertion Sort
  • Selection Sort
  • Bubble Sort
  • Merge Sort
  • Quick Sort
  • Shell Sort
  • Heap Sort
Data Structures
  • Queue
  • Stack
  • Dequeue
  • Priority Queue
  • Indexed Priority Queue
  • Disjoint Set (Union Find)
  • Tree
  • Binary Tree
  • Binary Search Tree
  • Immutable Set (based on binary search)
Search
  • Linear Search
  • Binary Search
Graphs
  • Breadth First Search
  • Depth First Search
  • Kruskal's minimum spanning tree
  • Prim's minimum spanning tree
  • Boruvka's minimum spanning tree
  • Dijkstra's shortest paths
Math
  • GCD / LCM
  • Newton Method
  • Binomial
Geometry
  • Gift wrapping (Jarvis)
  • Graham Scan
  • Quickhull
  • Voronoi Diagram (Naïve implementation)
  • Sierpinski triangle
Substring search
  • Knuth–Morris–Pratt (KMP)

License

Kotlin algorithm club is released under the MIT License.