Trees | Index | Help |
---|
Package flumotion :: Package common :: Module avltree |
|
Classes | |
---|---|
AVLTree |
Function Summary | |
---|---|
Print out a debugging representation of an AVL tree. | |
Delete a value from an AVL tree. | |
Populate and return an AVL tree from an iterable sequence. | |
Return the height of an AVL tree. | |
Insert a value into an AVL tree. | |
Iterate over an AVL tree, starting with the lowest-ordered value. | |
Iterate over an AVL tree, starting with the highest-ordered value. | |
Look up a node in an AVL tree. | |
Make an AVL tree node, consisting of a left tree, a value, a right tree, and the "balance factor": the difference in lengths between the right and left sides, respectively. |
Function Details |
---|
debug(tree, level=0)Print out a debugging representation of an AVL tree. |
delete(tree, value)Delete a value from an AVL tree. Likeinsert , returns a tuple of
(heightdifference, tree). The original tree is unmodified.
|
fromseq(seq)Populate and return an AVL tree from an iterable sequence. |
height(tree)Return the height of an AVL tree. Relies on the balance factors being consistent. |
insert(tree, value)Insert a value into an AVL tree. Returns a tuple of (heightdifference, tree). The original tree is unmodified. |
iterate(tree)Iterate over an AVL tree, starting with the lowest-ordered value. |
iteratereversed(tree)Iterate over an AVL tree, starting with the highest-ordered value. |
lookup(tree, value)Look up a node in an AVL tree. Returns a node tuple or False if the value was not found. |
node(l, v, r, b)Make an AVL tree node, consisting of a left tree, a value, a right tree, and the "balance factor": the difference in lengths between the right and left sides, respectively. |
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Oct 26 16:39:17 2008 | http://epydoc.sf.net |