Abstract

Parallel bubble sort.

This may be useful if you have almost-sorted data that you want to make fully-sorted in parallel. Obviously very slow for non-sorted data.

Synopsis

val bubble_sort [n] 't : (<=: t -> t -> bool) -> (xs: [n]t) -> [n]t
val bubble_sort_by_key [n] 't 'k : (key: t -> k) -> (<=: k -> k -> bool) -> (xs: [n]t) -> [n]t

Description

val bubble_sort [n] 't: (<=: t -> t -> bool) -> (xs: [n]t) -> [n]t

Parallel bubble sort. Runs with O(n^2) work and O(n^2) depth.

val bubble_sort_by_key [n] 't 'k: (key: t -> k) -> (<=: k -> k -> bool) -> (xs: [n]t) -> [n]t

Like bubble_sort, but sort based on key function.