AvlTree (gb.data)
AVL树是一种自平衡的二进制搜索树。这意味着可以保证在O(log n)时间内插入、删除和检索数据,而不管树中有什么数据。其接口类似于集合的接口。
Properties
Balance
|
Return the balance factor of the AvlTree. It is either -1, 0 or 1.
|
Count
|
Return the number of elements in the tree.
|
Height
|
Return the height of the tree.
|
Key
|
Return the last used key. This can be Null if the element was removed
meanwhile.
|
Methods
Clear
|
Clear the tree, i.e. remove all elements. This is way faster than
removing every element by assigning Null to it like this:
|
Exist
|
Return whether an element with the given key exists.
|
参见