This repo contains code that implements algorithms in Kotlin for both Part 1 and Part 2 Coursera courses.
There are several abstractions added to reduce code duplication and make it a bit more re-usable across different algorithms. There are also tests added to check the implementations and show how the algorithms are used.
The code in this repo is meant to be an educational supplement. You can use
./gradlew test
(or ./gradlew.bat test
if you're on Windows) to run all tests.
First data-structure explained in the course. The implementation is very close to that in the course.
Not explained in the course: an abstraction created to reduce code duplication caused by the need of having a resizable array in various algorithms later in the course.
Stacks & Queues data-structures implementations. Stack & Queue interfaces are implemented by using deques via adapters.
Not explained in the course: package contains a bunch of utility comparators for the ordered data-structures explained later in the course.
Not explained in the course: package contains an interface that enables the usage of any data-structure that supports index access with other data-structures. Contains adapters for an array and a deque.
All sorting algorithms as explained in the course. The only difference: all implementations expect indexable to enable sorting of any data-structure that supports index based operations, not only arrays.
Not explained in the course. A bunch of additional method for indexable to implement binary heap data-structure. Used in binary heap sort (see sorting).