Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Bubble sort
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cool dude




PostPosted: Mon Jan 30, 2006 12:52 pm   Post subject: Bubble sort

i'm trying to learn bubble sort and i can't get it. can somebody explain to me or show me a sample prog that i could learn from. AND NO i'm not asking u to do my homework besides i don't have any homework i just wanna learn bubble sort. if u post a sample prog please explain it with comments. thanks
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Jan 30, 2006 2:34 pm   Post subject: (No subject)

zylum has posted a number of sorting examples for Turing. Though if you're just trying to figure out the logic behind the algorythm, then language syntax should be irrelavent.

In bubble sort you essensially take elements one by one and compare them to all others, swaping a larger number to the end of the list, effectivly "bubbling" it up.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
cool dude




PostPosted: Mon Jan 30, 2006 6:54 pm   Post subject: (No subject)

thats a good tutorial thanks for pointing it out. and thanks to zylum for making it. the only problem i'm having now is i'm trying to get the numbers to sort from a file so i'm sorting it all correctly, but i wanna display it in a list box. i don't know how to display the sorted numbers in the list box. i'm trying somethin like this:

code:

lstSort.AddItem nums(i)


this however doesn't sort everythin. how would i display it in the list box?
Tony




PostPosted: Mon Jan 30, 2006 9:49 pm   Post subject: (No subject)

I would guess that you'd need to sort your nums() array before adding elements to the list box.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
cool dude




PostPosted: Mon Jan 30, 2006 11:53 pm   Post subject: (No subject)

how does bubble sort and selection sort differ?
person




PostPosted: Tue Jan 31, 2006 5:03 pm   Post subject: (No subject)

http://www.compsci.ca/v2/viewtopic.php?t=10914
cool dude




PostPosted: Tue Jan 31, 2006 7:18 pm   Post subject: (No subject)

thanks for the help i already figured it out. Smile
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: