Computers, however, can not just look at a list and judge automatically where the card belongs. To implement insertion sort in Java, you'll need to move each item in turn down the already sorted list, comparing it to each already sorted item. Once you find an item that is longer than the item in question or you reach the end of the list, insert the item at that position. Use the sorting Demo program available by following this link to get a sense of how insertion moves each line down the already sorted list to find its place and then try to write an insertion sort of your own. If you've played around with the various sorts in the demo program, you've probably noticed that some sorts take longer than others to complete.
Speed is a very important factor in sorting and in computer science in general.
In fact, the sorts you have written today are generally not used for sorting significant amounts of numbers because they are too slow. Instead, a sort like quicksort, which is less intuitive but far faster, is usually used. To figure out the speed of a sort, look at the number of compares and swaps necessary to complete the sort. Selection sort, however, requires only as many swaps as it does items, for it swaps only once during each pass. Try to figure out the speed of insertion sort and include your result in your email to the account.