One commonly used sorting algorithm is called selection sort. Here's how it works:
(Don't take the word "step" too literally; you'll probably see when you write the code that at least steps 3-4 are in a single report block.)
to compare two items. On the next page you'll modify your program to sort the contact list.sort block with no help at all, do it now.
Otherwise you can click here.sort block in Snap!, you'll need code for a base case, and code that follows the steps of the selection sort.
block will compare words, using alphabetical order, not just numbers.earliest in block. For names, this returns the first name alphabetically in a list:

min block that takes two inputs and reports whichever is smaller. (You've done this before, but it's probably quicker to do it again than to find it in some earlier project and import it.) earliest block using combine.
that reports a list that's a copy of its second input, but with its first input removed.
keep if you assume that there are no equal items in the list. That's fine for now, although a correct sorting algorithm will keep all duplicate items in the result.
or
in this problem, but your sort block should report a new sorted version of the list, without changing the original list. Sometimes it's okay to modify the original list, but sometimes it isn't, so go for the most generally useful solution.
sort.
sort call itself?


![set (baby names) to (http:// [bjc.edc.org/June2020bjc2/bjc-r/cur/programming/3-lists/2-sorting/yob2014.txt])](/June2020bjc2/bjc-r/img/3-lists/baby-names-get.png)
bjc.edc.org/June2020bjc2/bjc-r/cur/programming/3-lists/2-sorting/yob2014.txt


split.map used in part (d) but not in part (c)?set isn't the most beautiful style, although it's great for explaining the steps. Over time, try to develop the habit of doing this instead:
names starting with.