Perl, time efficient hash

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-06-12T18:22:12Z Indexed on 2010/06/12 18:32 UTC
Read the original article Hit count: 179

Filed under:
|
|

Is it possible to use a Perl hash in a manner that has O(log(n)) lookup and insertion?

By default, I assume the lookup is O(n) since it's represented by an unsorted list.

I know I could create a data structure to satisfy this (ie, a tree, etc) however, it would be nicer if it was built in and could be used as a normal hash (ie, with %)

© Stack Overflow or respective owner

Related posts about perl

Related posts about hash