Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Sorting array

by Laurent_R (Parson)
on Jun 15, 2013 at 22:03 UTC ( #1039163=note: print w/ replies, xml ) Need Help??


in reply to Sorting array

I am surprised that nobody yet has suggested that you take a look at something relatively famous called the 'Schwartzian Transform', a quite powerful algorithm for sorting slightly complicated data such as the one you have, especially if you have a lot of data (where is is much faster, because it avoids duplicating some part of processing many times), but also quite practical in my view even if your data is quite small. It is sufficiently well known to have an article in Wikipedia (in many languages) and pages in many thousands of other sites. Just google it, or, if you prefer or are not completely convinced that Google is your friend these days, go to some initial pointers on it on Perlmonks:

What is "Schwarzian Transform" (aka Schwartzian)

Schwartzian Transform

Sorting dates with the Schwartzian Transform


Comment on Re: Sorting array

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-09-18 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (128 votes), past polls