Saturday, November 3, 2018

Bubble Sort

What is a bubble sort? In 3-5 sentences, write out its pseudocode. Bubble sort is generally seen as one of the slowest (and not very smart) ways to sort numbers. Why does it take so long? What does it have to do to sort all its numbers?
Bubble sort is an algorithm where it takes a set of numbers and puts them in order from smallest to largest.  Create a for loop that takes the users input of a random set of numbers. Create another for loop that goes through the numbers and puts them in order. Create some variables to help you put in the numbers in the variables and a variable that is a holder. Use these variables to put the numbers in order. It is very slow and not as effective as other programs because it has to run through the whole set of numbers over and over, beginning to end so it can sort it out. 

No comments:

Post a Comment