Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: [ Natural Sort ]: Sorting a string with numbers

by hv (Parson)
on Aug 13, 2005 at 00:42 UTC ( #483474=note: print w/replies, xml ) Need Help??


in reply to [ Natural Sort ]: Sorting a string with numbers

One small additional facet: because the (packed) index is appended to the key, this will gave you a stable sort even if the underlying sort is unstable.

See sort for more details about what that means, and when it might be relevant.

Hugo

  • Comment on Re: [ Natural Sort ]: Sorting a string with numbers

Replies are listed 'Best First'.
Re^2: [ Natural Sort ]: Sorting a string with numbers (stable?)
by tye (Sage) on Aug 13, 2005 at 01:06 UTC

    Usually... (as bart pointed out in fast, flexible, stable sort)

    If you have fewer than 16.7 million records and none of the records contain "\0" characters, then it always works, for example.

    - tye        

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2021-05-10 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (105 votes). Check out past polls.

    Notices?