Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 741 Bytes

README.md

File metadata and controls

33 lines (21 loc) · 741 Bytes

Simplest sort

Showcases the simplest sorting algorithm that works in quadratic time. From here.

The pseudocode for this algo can be seen below (sorts an array with n elements in non-decreasing order):

for i from 0 to n:
    for j from 0 to n:
        if Ar[i] < Ar[j]:
            swap(Ar[i], Ar[j])

This repository houses a go program that uses exactly this algo, but animates how it works on your terminal! Demo below:

Screencast

Usage

Assuming you have git and go installed, you can simply clone and run.

git clone https://github.com/radiantly/simplest-sort
cd simplest-sort

go run .

Should work on any modern terminal.

License

MIT