Skip to content

ris0/sorting_algorithms

Repository files navigation

Sorting Algorithms

Bubble and merge sorts are much faster than the native JavaScript sort.

Bubble sort

Bubble sort looks over the elements, swaps anything that is out of order, and repeats until it is finished.

space complexity: O(1)

time complexity: O(n^2)

Merge sort

Merge sort divides an array of N elements into N arrays of 1 element, merges adjacent arrays in sorted order, and repeats until it is finished.

space complexity: O(n)

time complexity: O(n * log(n))

About

Bubble and Merge sort algorithms with tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published