Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: A short meditation about hash search performanceby Courage (Parson) |
on Nov 16, 2003 at 13:27 UTC ( [id://307461]=note: print w/replies, xml ) | Need Help?? |
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.
Best regards,
In Section
Meditations
|
|