array in order
Author |
Message |
scorpion1087
|
Posted: Tue Oct 14, 2003 6:19 pm Post subject: array in order |
|
|
how do i display the numbers in an array in order? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Tue Oct 14, 2003 8:28 pm Post subject: (No subject) |
|
|
You should read a tutorial on arrays, I've wrote one here
If there's something you're interested in, check tutorials to see there's anything posted about it |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Blade
|
Posted: Wed Oct 15, 2003 11:57 am Post subject: (No subject) |
|
|
teacher taught us to bubble sort like this...
code: | var switch:boolean:=false
var ii:int:=0
var temp:string:=""
loop
ii+=1
for i:1..10 - ii
if(nums(i) > nums(i+1))then
temp:=nums(i)
nums(i):=nums(i+1)
nums(i+1):=temp
switch:=true
end if
end for
exit when not switch or ii >= 10
end loop |
cant remember for sure, and i cant test it and figure it out right now cuz i'm gonna be late.. |
|
|
|
|
|
Dan
|
Posted: Wed Oct 15, 2003 10:58 pm Post subject: (No subject) |
|
|
thats defutaly not the traditan way of doing bubble sort. it uhsaly uses two for loops and dose not have a exit when line |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
|
|