Menu

how to sort a set of numbers in dev pascal

2002-09-04
2012-09-26
  • Nobody/Anonymous

    how can you make the program sort a set of numbers in order

     
    • Nobody/Anonymous

      They're are more possible ways to do this than you could ever imagine, but here's a simple but fairly inefficent way. (I'm gonna assume you know pascal, 'cause i don't. )

      You have a set (or an array) of numbers of a given size. You start with the first number and see if it's bigger than the second, if it is, switch it.

      Regardless, test the second and third numbers in the same way.

      Sort until no switches take place

       
    • Nobody/Anonymous

      You might try a search on a couple of alogorithms, like:
      bubble sort
      shell sort

      I tried a quick google on "shell sort pascal" and came up with a number of useful hits, including code listings.

      google is our friend.   :-)

      Wayne

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.