Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: A short meditation about hash search performance

by Courage (Parson)
on Nov 16, 2003 at 13:27 UTC ( #307461=note: print w/replies, xml ) Need Help??

in reply to A short meditation about hash search performance

Best search performance could be reached as O(log(N)) by using balanced tree.
You could implement this as a perl module, although this will be much slower than internal implementation O(N).
Also do not forget that adding into search list also counts, and I think adding into a hash would cost O(1)

It is know that commonly used in C library qsort is also O(N*N) in worst case and something like O(N*LOG(N)) in real life.
Also sorting method changed to mergesort in perl-5.8.0 and it was qsort for earlier perls.

Best regards,
Courage, the Cowardly Dog

  • Comment on Re: A short meditation about hash search performance

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://307461]
[Corion]: Discipulus: You got pushed too much under water?
[Corion]: marto: Oooh - cinema... I guess that's something I could do with my godson and sibling and sister as well, but I guess that getting a six year old and two four year olds into one movie is a tough sell ;)
[marto]: busy weekend, no me time :P
[Corion]: marto: Yeah, that's somewhat implied :) I was on the phone with my godson yesterday (they birthday), but I haven't seen them for two weeks now (vacation), relaxing, but I somewhat miss them too ;)
[Discipulus]: me waterpolo? oh no! i'm a no sport; the tournment was for the elder son
[karlgoethebier]: good morning
[Corion]: Discipulus: Ah, so he's the one getting almost drowned all the time - waterpolo certainly is no sport for me ;)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-07-24 08:11 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (348 votes). Check out past polls.