|
Post by Migs on Nov 21, 2008 3:18:31 GMT
Hi, I'm new to programing and my teacher just assigned an assignment dealing with quickBASIC. I have a list of numbers and I have to come up with some sort of program to organize the data from smallest to largest. I've learned the basic commands for the most part but I still have not been able to make a program that will sort the data. I tried to first add the data with the DATA command then tried to come up with a loop or something of the type that would go through and compare values, two at a time and put them in order, a bubble sort I belive... I just can't get it to work, any help would be appreciated.
|
|
clippy
Junior Member
Posts: 32
|
Post by clippy on Nov 21, 2008 6:13:21 GMT
Hope you know how to use an Array! Place the values into an Array and SWAP the values if the first value is greater. Keep doing that until you no longer have to SWAP anymore. Assign a variable as a flag that tells you when no more swaps were made to exit the SWAP loop.
Ted
|
|