A few useful stocks until official versions are added. These follow the same format as adt_array and adt_trie (even when I dislike it) just to maintain compatibility.
Deque:
Meets all deque requirements for speed, at the sacrifice of space
Space grows linearly, but quicker than it could
Worst case for space is queue (unfortunately)
Queue:
Based on deque (soon to be based on circular buffer)
Meets all queue requirements for speed
Stack:
Based on adt_array
Meets all stack requirements for speed
TravTrie:
Based on adt_trie and adt_array
Retrieve has no slow down
insert has O(1) slow down
delete has O(logn) or O(n) slow down
constant iteration provided through Plugin Iterator like mechanism
iteration occurs in O(n) unsorted, O(nlogn) sorted
TravTrie Tripups:
1. Getting the string key (not the value) will not increment the iterator
2. A function is provided to sort the travtrie if wanted
Note: These functions have been compile tested and moderately runtime tested, but not stress tested (except for queue and travtrie). Tell me if an error occurs.
Please tell me how if you like it!
__________________
.png" rel="nofollow noopener">
Last edited by Twilight Suzuka; 03-23-2008 at 06:36.
Reason: Enhanced