Re: "Sorting" assignment



Willem wrote:

You know, I just realized something.

Selection sort very easily evolves to Heapsort.
(Heapsort is selection sort,
but with a log-n datatype for the selection)

Bubble sort (a lot less neatly) evolves to Quicksort.
(Both involve swapping elements on the basis of comparisons)

Knuth classifies heapsort as a selection sort,
and he classifies both bubblesort and quicksort as exchange sorts.

--
pete
.



Relevant Pages

  • Re: A "valid" Bubble sort algorithm?
    ... >> The Bubble Sort has it's place in programming. ... At least one of Insertion Sort or Selection Sort is *not* stable. ... | Charles and Francis Richmond ...
    (comp.programming)
  • Re: A "valid" Bubble sort algorithm?
    ... >> The Bubble Sort has it's place in programming. ... both Insertion Sort and Selection Sort are stable. ...
    (comp.programming)
  • Re: Selection sort and bubble sort
    ... as opposed to selection sort as I had done in ... bubble sort won't change the behavior when it goes bad. ... three or so passes over the list of items, but quicksort will ...
    (comp.programming)