"Anonymous" <r1a@[EMAIL PROTECTED]
> wrote in message
news:DomUi.1524$Qr.74@[EMAIL PROTECTED]
> How can ARRAY SORT sort from 2,10,12,7,5,8,1,3,5 to12,10,8, 7,5,2,1,3,5?
> As you can see the table isn't sorted; neither in ascending nor
descending
> order. At least not the whole part of it.It would be very hard for ARRAY
> SORT to find which item in the table should be moved; in accordance with
> how a heap data structure should be organized.
>
> Secondly I'm currently studying Algorithms and Datastructures at the
> moment, and this code is about the heap structures, as you probably
> spotted.
> PB is just a tool in this study, not the target.
Well, it looked like some kind of sort. (I am not a C programmer).
> I don't think ARRAY SORT would be just as efficient here.Direct memory
> manipulation, as in the C code, would be much more preferable.
> --
You don't think ARRAY SORT would be as efficient as direct memory
manipulation? Um, what do you think the compiler does when your source
code
reads "ARRAY SORT ..??" (Hint: the initials are "direct memory
manipulation").
Then again, using ARRAY SORT doesn't really teach you much about
structures
and memory management. Of course, that's why people actually purchase
licenses for high-level language products, so they don't have to do all
that
dirty work themselves.
MCM


|