Algorithm: Difference between revisions

Content deleted Content added
Isis~enwiki (talk | contribs)
m giving example
Isis~enwiki (talk | contribs)
m fix typo
Line 6:
** a. If the 1st one is alphabetically ahead of the 2nd one, go to step 2.
** b. If the 2nd one is alphabetically ahead of the 1st one, swap the two of them and then go to step 2.
* Step 2. Pretend the 2nd and 3rd names on the list are the 1st and 2nd ones, and repeat step 1.
This is a rule either a human being or a computer can use to alphabetize a list -- it's called a "[Bubble sort|bubble sort]]", because the entries that belong at the top of the list eventually float up to the top, but it's not a very efficient way to get the job done. So it's not a particularly good algorithm to use, but it's a fair example of what an algorithm is.