Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
alfabetic order
#21
Aga, you posted a 9 line iteritave quicksort in the challenge section a long time ago...
Reply
#22
Yes, that's true. However, notice the date of that post......
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#23
The time you made it makes it invalid?
Reply
#24
I posted that before I posted the one in the challenges Forum....... :|
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#25
I'm still looking for a text description of quick sort, but if you're
looking for a game send me an email. I have the greatest
Keno game ever.
d12connelly@yahoo.com
Reply
#26
Last post: October 07 2003

Your post: March 29 2004


Stop posting everywhere, posting it once is enough... This just makes people mad at you....

*smacks david9c...* Reviver.. pfffft.... :lol:
Reply
#27
BanAnnA,
Sumojo's "bubble" sort looks pretty good, although a little inefficient, purely from a aesthetic point of view. For sorting small amounts of data, say 100-200 elements, its a nice solution. Actually it's not a bubble but a sift sort.

Do you know what a bubble sort does and why it's called a "bubble" sort? The whole idea is to start at one end of the list to be sorted, and compare adjacent list elements. In the case of a bubble sort, you start at the bottom, compare adjacent elements, swap them if the one nearest the top of the list is greater. If you did a swap you set a switch which means "I did a swap so some elements are not in order". Basically, you keep doing this until the lowest element "bubbles" up to the top of the list. When you go through the list and don't need to do a swap, then the entire list is in order.

Most people, like Sumojo, prefer to process the list starting from the top. This then is called a "sift" sort because the highest element "sifts" down to the bottom of the list. The implementation is fundamentally the same as a bubble.

The bubble and sift are the simplest to understand. You should try to understand these to begin with. Take Sumojo's code and imbed it into a test program a run tests on it until you understand. Forget Quicksort for now, it will confuse you.
Good luck.
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)