Skip to content

deemson/algorithms

Repository files navigation

Algorithms

Summary

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.

How to use

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.

Contents

01. Union Find

Docs

Test

First data-structure explained in the course. The implementation is very close to that in the course.

02. Deques

Docs

Test

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.

02. Stacks & Queues

Docs

Stacks Test

Queues Test

Stacks & Queues data-structures implementations. Stack & Queue interfaces are implemented by using deques via adapters.

03. Comparators

Docs

Not explained in the course: package contains a bunch of utility comparators for the ordered data-structures explained later in the course.

03. Indexable

Docs

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.

03. Sorting

Docs

Test

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.

04. Binary Heap

Code

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).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages