Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^5: sorting random numbers

by Ratazong (Monsignor)
on Oct 07, 2016 at 19:36 UTC ( #1173503=note: print w/replies, xml ) Need Help??

in reply to Re^4: random perversity
in thread random #s

Sorting numbers without using sort is (in my eyes) a useful task in a beginners programming course. The student learns something about arrays here - and possibly something about algorithms and about partitioning a big problem (change the order of a huge list) into small steps (exchange two elements). So in my eyes it is far from being perverse.

However the goal of the task is not reached if the student just copies some lines found in the internet. Speaking of this, I'm tempted to advise to use David Morgan-Mar's algorithm intelligent design sort - as it is easy to implement and very fast, especially for huge amounts of data.

So long, Rata

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1173503]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2020-06-04 18:43 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (35 votes). Check out past polls.