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

Username:   Password: 
 RegisterRegister   
 array in order
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
scorpion1087




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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 Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Blade




PostPosted: 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




PostPosted: 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 Confused
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: