Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: sorting agorithm

by JavaFan (Canon)
on Aug 13, 2009 at 09:47 UTC ( [id://788181]=note: print w/replies, xml ) Need Help??


in reply to Re: sorting agorithm
in thread sorting agorithm

And now including the lines that do not contain the word "algorithm":
               Perl 5.6 and earlier used a quicksort algorithm to implement
               sort.  That algorithm was not stable, and could go quadratic.
               (A stable sort preserves the input order of elements that
               compare equal.  Although quicksort’s run time is O(NlogN) when
               averaged over all arrays of length N, the time can be O(N**2),
               quadratic behavior, for some inputs.)  In 5.7, the quicksort
               implementation was replaced with a stable mergesort algorithm
               whose worst-case behavior is O(NlogN).  But benchmarks
               indicated that for some inputs, on some platforms, the original
               quicksort was faster.  5.8 has a sort pragma for limited
               control of the sort.  Its rather blunt control of the
               underlying algorithm may not persist into future Perls, but the
               ability to characterize the input or output in implementation
               independent ways quite probably will.  See sort.

Replies are listed 'Best First'.
Re^3: sorting agorithm
by Anonymous Monk on Aug 13, 2009 at 09:55 UTC
    I see you used
    perldoc -f sort | grep -C5 algo
    :)
      Considering that the first line of my quote contains the word 'algorithm', you're obviously very, very wrong.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-18 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found