Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It is certainly not a "classic" bubble-sort but a curious mix of elements of an exchange sort (namely the swapping of the current record with the smallest remaining record) and an inverted type of insertion sort (namely finding the next smallest record and putting it directly in its place) None of these sorts are known to be fast or efficient and by combining them you probably get the worst elements of both. If this is homework, it is bad homework. I would never suggest a student to implement such a bad algorithm. To know more about sorting in general, one could do worse than read Don Knuth's "The Art of Computer Programming - Vol. 3 - Sorting and Searching". CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law In reply to Re: Re: Tedious array sort revisited
by CountZero
|
|