Re: "Sorting" assignment



On Feb 6, 10:52 pm, spinoza1111 <spinoza1...@xxxxxxxxx> wrote:
On Feb 6, 12:20 am, Julienne Walker <happyfro...@xxxxxxxxxxx> wrote:
On Feb 5, 10:56 am,spinoza1111<spinoza1...@xxxxxxxxx> wrote:

What's interesting is how excited people have gotten about truly de
minimis performance issues while claiming, in practice, that an N^2
algorithm such as tbe bubble sort should be given a free pass because
it seems, oh, so very simple. Sure, it's simple, so simple that in
implementing it you learn nothing of value.

Learning bubble sort can teach you a lot about algorithms. For

Cf. Thomas H Cormen et al. Introduction to Algorithms MIT 2001. Cormen
starts with insertion sort because it doesn't quite square the array
length, and his first full chapter on sorting describes heap and quick
sorting.

Note that I said bubble sort can teach a lot about algorithms, not
that it *should* be taught as a first sorting algorithm or that
everyone teaches it as a first sorting algorithm. I even explained how
I would tailor which algorithm to start with by how the student thinks
and that this will almost always result in insertion sort or selection
sort. ;-)

example, you can use bubble sort as a simple implementation for adding
step-based execution and performance analysis. It's a simple algorithm
for introducing asymptotic notation and time complexity. It's also an
immediately useful exercise that covers non-trivial loop and array
logic, modularization, and comparison based sorting. I'd hardly call
that "nothing of value".

Nothing of beauty.

The reality of programming is that it's not always elegant or
beautiful. If you only learn the beautiful side of programming, you
won't be very useful in the real world.

I'd say that the students have the right to start
with something of reasonable elegance and beauty which derives that
elegance and beauty from the fact that we developed this algorithm
before computers. The insertion sort can be illustrated and is
illustrated by Cormen using a poker hand.

I'd say that the students have the right to start with whatever is
easiest for them to understand. That way they can progressively learn
the gamut of algorithms and build on existing knowledge. Once more
I'll offer myself as an example. I didn't understand the "poker hand"
explanation of insertion sort at first. I had a much easier time of
things once I had a couple of sorting algorithms under my belt.

It doesn't matter how elegant an algorithm is if the student can't
wrap her mind around it.

Keep in mind that those learning bubble sort are likely to be very new
to programming, so while implementing the algorithm won't teach *you*
anything, it's very instructive to a less experienced programmer.

<snip> However, he did see
a contradiction between the tentative way in which people talk about
other people in sets and classes (such as "less experienced
programmer") in such a way that the rule governing the set replaces
thought.

I get the impression you're basically saying "exceptions exist".
That's nice, but exceptions are just that: exceptions. You're welcome
to show me a study or two that proves students learn nothing from
bubble sort, but until then I'll maintain that lessons can be learned
even from an "ugly" algorithm.


-Jul
.



Relevant Pages

  • Re: "Sorting" assignment
    ... If you only learn the beautiful side of programming, ... elegance and beauty from the fact that we developed this algorithm ... The insertion sort can be illustrated and is ... English grammar, apparently, than many English speakers, a noun phrase ...
    (comp.programming)
  • Re: "Sorting" assignment
    ... algorithm such as tbe bubble sort should be given a free pass because ... I would tailor which algorithm to start with by how the student thinks ... If you only learn the beautiful side of programming, ...
    (comp.programming)
  • Re: puzzle
    ... >> Christopher Barber wrote: ... >> or understanding among programming professionals. ... > algorithm "close to" O. ... bubble sort, it is almost always acceptable to use an interchange sort: ...
    (comp.programming)
  • Re: The ultimate luxury ?
    ... >>My definition in terms of imposing a linear order on a set is abstract ... >>and corresponds not to the algorithm of sorting, ... > that the CS dudes of today would not know what sort means. ... Jesse Hughes ...
    (sci.physics)
  • Re: Help me with references
    ... I can't think of any situation in which bubble sort is ... > best choice for a sorting algorithm in a real machine. ... Quicksort is optimized for large Ns. ... I picked Bubblesort because your original post implied something along ...
    (comp.lang.java.help)