11d42882b5
* NEW: Update copyright years. * NEW: Have a stripped-down version of gb_common_string_temp.h to provide STRING_compare() without producing compilation problems. * NEW: AvlTree is a new Collection-like class implementing a balanced binary search tree. It does _not_ utilise hashing in order to maintain an order of the literal key strings given by the user (For Each thus traverses from smallest to greatest key). * NEW: Carry in a stripped-down version of Bob Jenkins' lookup3 hash algorithm from the Public Domain. It was a last-minute decision to not use it in AvlTree to maintain the literal key order. git-svn-id: svn://localhost/gambas/trunk@5812 867c0c6c-44f3-4631-809d-bfa615b0a4ec
32 lines
1.5 KiB
Text
32 lines
1.5 KiB
Text
NOTE that one should not compare elements in a list based on their indices.
|
|
If List2 is an exact copy of List1 and both Currents point to the same
|
|
element, it is not guaranteed that List1.Index = List2.Index because one of
|
|
them could be the negative equivalent of the other (non-negative) one.
|
|
|
|
* OPT: Dynamically add up to 8 anchors to increase the chance of finding a
|
|
very good anchor for traversals. These are automatically updated on
|
|
append/prepend/take operations to be widespread across the List.
|
|
* OPT: Also save an anchor of the last element obtained via _get().
|
|
Sequential traversal with indices should now be almost array-like in
|
|
speed.
|
|
|
|
* BUG: Current can be used as an enumerator now without corrupting the list
|
|
and also if it is initially invalid.
|
|
|
|
* OPT: Make the VAL_append()/prepend() algorithms more clever: They can use
|
|
any neighbour chunk now to borrow space for the inserted value. This
|
|
measure reduces list fragmentation and also enables to satisfy the (L)
|
|
postulate.
|
|
|
|
* NEW: Push() and Pop() are new methods of the List class to save and
|
|
restore anchors from a Gambas program. These can be used to quickly go
|
|
back to a formerly-visited element.
|
|
|
|
AvlTree:
|
|
|
|
* NEW: Add a Copy() method to return a deep copy of an AvlTree.
|
|
* NEW: Split() is a new method of AvlTree to return the left or right
|
|
subtree of a given node or both.
|
|
* NEW: Add Insert() to insert an AvlTree into another one.
|
|
* NEW: Add PreOrder, PostOrder, Reverse and LevelOrder virtual properties to
|
|
specify the enumeration flavour.
|