Skip to content

Instantly share code, notes, and snippets.

@housingdreams
Created October 5, 2021 22:50
Show Gist options
  • Select an option

  • Save housingdreams/13bb526d7bd0b127e05997082d40eb78 to your computer and use it in GitHub Desktop.

Select an option

Save housingdreams/13bb526d7bd0b127e05997082d40eb78 to your computer and use it in GitHub Desktop.
Strangely simple sort

https://arxiv.org/pdf/2110.01111.pdf

	values := []int{2, 4, 1, 8, 6, 889, 30, 23, 2, 5, 723}

	for i := range values {
		for i2 := range values {
			if values[i] < values[i2] {
				values[i], values[i2] = values[i2], values[i]
			}
		}
	}
const values = [90, 15, 81, 87, 47, 59, 81, 18, 25, 40, 56, 8]

for (let i = 0; i < values.length; i++) {
    for (let j = 0; j < values.length; j++) {
        if (values[i] < values[j]) {
            var tmp = values[i];
            values[i] = values[j];
            values[j] = tmp;
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment