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

Re: Sorting array

by Laurent_R (Abbot)
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?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2016-04-30 14:43 GMT
Find Nodes?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW

    Results (441 votes). Check out past polls.