-
1 Attachment(s)
Bubble sort in vb6
i have been teaching myself c++. what i ended up doing was translate all the c++ codes in the book to vb6 :D .anywas, here is a small exmple of bubble sort. just sort given numbers in order.
for this purpose, there is a prompt for the size of myArr, it is the number of numbers to sort.
WARNING:Totally undocumented and hopeless way of coding. dont follow this example of coding for professional purposes.....
-
Re: Bubble sort in vb6
Your Bubble sort is in fact a "Selection Sort" that works by selecting the smallest item remaining in the list and swapping it with the item at the next position.
in fact your implantation is fast and more efficient then a bubble sort as it the most slowest one.
anyway nise code.
-
Re: Bubble sort in vb6
thanx dreamvb. i'm not much good at naming algorithms and i dont look forward to polish the code in anyways. so if anybody wants to polish the code and put in comments, they're welcome to do so.....