Bubble SortBy: Yoo Lee & Gabrielle Ortiz Block 2A
Basic Introduction:Bubble Sort is a simple yet effective sorting algorithm.Data is placed adjacent to each other.The sort starts from one end (the beginning), compares2 adjacent data, and swaps them if they are in thewrong order.It moves on down the list and continues doing so.When it reaches the end of the data, it starts over untilall the data is in the right order.*As easy as the Bubble Sort is, it is sometimesineffective if there is a lot of data.
When to Use Bubble SortNot much use in the real world, but is a great learning toolbecause it’s easy to understand and fast to implement.Use when a fast algorithm is needed to sort: 1.) an extremely small set of data (Ex. Trying to get the books on a library shelf back in order.) or 2.) a nearly sorted set of data. (Ex. Trying to decide which laptop to buy, because it is easier to compare pairs of laptops one at a time and decide which you prefer, than to look at them all at once and decide which was best.)
When to Not Use Bubble SortWhen dealing with a large set of data.When you are looking for a quick algorithm.Compared to other sorting algorithm, bubble sort isreally slow.