----------------------------------- we64 Tue Jan 27, 2004 9:50 pm How to put numbers in order? ----------------------------------- If I have values like 5,1,15,12,54,34,23,35, how to put them from smallest to largest? ----------------------------------- Neja Tue Jan 27, 2004 10:14 pm ----------------------------------- Find their ASCII values and use an if statement. ----------------------------------- AsianSensation Tue Jan 27, 2004 10:29 pm ----------------------------------- store it in an array, then sort it. ----------------------------------- Dan Tue Jan 27, 2004 10:50 pm ----------------------------------- if u use that search thing on the top of the site u could have found a post such as this: http://www.compsci.ca/v2/viewtopic.php?t=447&highlight=sorting ----------------------------------- we64 Tue Jan 27, 2004 11:12 pm ----------------------------------- Thanks guys, I made my works. ----------------------------------- Cervantes Wed Jan 28, 2004 8:52 am ----------------------------------- ascii values and an if statement? hmmmm.. I must try this, I've always used arrays, seems the easiest way ----------------------------------- Delos Wed Jan 28, 2004 10:47 am ----------------------------------- Ah, sorting. How we all love thee? I guess bubble-sort is best for beginners...though it is so slow! Has anyone been able to implement a quick-sort in Turing? I was thinking of trying out some time. ----------------------------------- McKenzie Wed Jan 28, 2004 11:30 am ----------------------------------- It's more than just a beginner vs advanced debate. First you must determine the need for speed. Is the array being sorted each time you refresh your screen ? (very high need) or is it just when you check your high score list (very low need). On top of that you have to look at the size of the array that it will be used on. Although bubble sort is of order O(n^2) and quicksort is O(n Log(n)) there is a lot of overhead in quicksort making it slower on small samples (