Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: random perversity

by hippo (Bishop)
on Oct 07, 2016 at 16:31 UTC ( [id://1173493]=note: print w/replies, xml ) Need Help??


in reply to Re^3: random #s
in thread random #s

cboPerl wants to sort some numbers without using sort. That's the very definition of perverse and there seems to be little point in offering any type of logical advice regarding such an endeavour.

Replies are listed 'Best First'.
Re^5: sorting random numbers
by Ratazong (Monsignor) on Oct 07, 2016 at 19:36 UTC

    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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-03-29 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found