On 3/20/2013 2:44 AM, Robert Wessel wrote:

> On Tue, 19 Mar 2013 15:38:53 -0700, Tim Rentsch

>[...]

>> Your comment is made with the benefit of already understanding

>> how both work, and made by someone who knows a lot about

>> programming. Try explaining each idea to a six-year old.

>> I would claim that more will get the idea behind bubble sort

>> than insertion sort (or get it faster, or more easily, etc).

>

> I think there is certainly some room for disagreement here. An

> insertion sort is a common method used to sort a hand of playing

> cards.
The very first sorting method I learned was selection:

Find the largest element and move it to the end of the array,

find the largest of the first N-1 and move it to the next-to-

last spot, and so on. I still think it's about the simplest

method I've ever seen: Both simple to implement and simple to

understand.

(Not very fast, though: It always makes N*(N-1)/2 comparisons

and N-1 swaps, even if the array is already sorted. I "invented"

what I later learned was bubble sort in an attempt to exploit

existing order if there was any, but at that age my mathematical

prowess was insufficient to analyze the algorithm.)

--

Eric Sosman

(E-Mail Removed)d