moudio / Bubble_sort

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bubble_sort

This project is an implementation of bubble sort in ruby

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent pairs and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. The algorithm, which is a comparison sort, is named for the way smaller or larger elements "bubble" to the top of the list. Although the algorithm is simple, it is too slow and impractical for most problems even when compared to insertion sort. Bubble sort can be practical if the input is in mostly sorted order with some out-of-order elements nearly in position. know more

Live version

Repl.it: Preview

Author

About


Languages

Language:Ruby 100.0%