Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039163]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2017-05-29 04:51 GMT
Find Nodes?
    Voting Booth?