Level 2: Identical to level 1 only faster. The array with sorted keys and hash lookup table are only recreated when a new key is added, a value is changed, or the sort routine is changed.
That's not necessarely faster. It depends on how often you are inserting and how often you are asking for the keys. What you could do is some form of hybrid:
Deleting a key doesn't require a rebuild because the element is deleted from the array and the lookup hash.
Are you aware that deleting an element from an array can take time linear in the size of the array?
Abigail
In reply to Re: Any Point in Uploading Tie::SortedHash
by Abigail-II
in thread Any Point in Uploading Tie::SortedHash
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |