File: avl-tree.el.html

An AVL tree is a self-balancing binary tree. As such, inserting, deleting, and retrieving data from an AVL tree containing n elements is O(log n). It is somewhat more rigidly balanced than other self-balancing binary trees (such as red-black trees and AA trees), making insertion slightly slower, deletion somewhat slower, and retrieval somewhat faster (the asymptotic scaling is of course the same for all types). Thus it may be a good choice when the tree will be relatively static, i.e. data will be retrieved more often than they are modified.

Internally, a tree consists of two elements, the root node and the comparison function. The actual tree has a dummy node as its root with the real root in the left pointer, which allows the root node to be treated on a par with all other nodes.

Each node of the tree consists of one data element, one left sub-tree, one right sub-tree, and a balance count. The latter is the difference in depth of the left and right sub-trees.

The functions with names of the form "avl-tree--" are intended for internal use only.

Defined variables (0)

Defined functions (63)

avl-tree--check(TREE)
avl-tree--check-node(NODE)
avl-tree--cmpfun(avl-tree--cmpfun X)
avl-tree--cmpfun--inliner(INLINE--FORM X)
avl-tree--create(CMPFUN)
avl-tree--create--cmacro(CL-WHOLE-ARG CMPFUN)
avl-tree--del-balance(NODE BRANCH DIR)
avl-tree--dir-to-sign(DIR)
avl-tree--do-copy(ROOT)
avl-tree--do-del-internal(NODE BRANCH Q)
avl-tree--do-delete(CMPFUN ROOT BRANCH DATA TEST NILFLAG)
avl-tree--do-enter(CMPFUN ROOT BRANCH DATA &optional UPDATEFUN)
avl-tree--dummyroot(avl-tree--dummyroot X)
avl-tree--dummyroot--inliner(INLINE--FORM X)
avl-tree--enter-balance(NODE BRANCH DIR)
avl-tree--mapc(MAP-FUNCTION ROOT DIR)
avl-tree--node-balance(avl-tree--node-balance X)
avl-tree--node-balance--inliner(INLINE--FORM X)
avl-tree--node-branch(BRANCH NODE)
avl-tree--node-create(LEFT RIGHT DATA BALANCE)
avl-tree--node-create--cmacro(CL-WHOLE-ARG LEFT RIGHT DATA BALANCE)
avl-tree--node-data(avl-tree--node-data X)
avl-tree--node-data--inliner(INLINE--FORM X)
avl-tree--node-left(avl-tree--node-left X)
avl-tree--node-left--inliner(INLINE--FORM X)
avl-tree--node-right(avl-tree--node-right X)
avl-tree--node-right--inliner(INLINE--FORM X)
avl-tree--root(TREE)
avl-tree--sign-to-dir(DIR)
avl-tree--stack-create(TREE &optional REVERSE)
avl-tree--stack-p(X)
avl-tree--stack-p--inliner(INLINE--FORM X)
avl-tree--stack-repopulate(STACK)
avl-tree--stack-reverse(avl-tree--stack-reverse X)
avl-tree--stack-reverse--inliner(INLINE--FORM X)
avl-tree--stack-store(avl-tree--stack-store X)
avl-tree--stack-store--inliner(INLINE--FORM X)
avl-tree--switch-dir(DIR)
avl-tree-clear(TREE)
avl-tree-compare-function(TREE)
avl-tree-copy(TREE)
avl-tree-create(COMPARE-FUNCTION)
avl-tree-delete(TREE DATA &optional TEST NILFLAG)
avl-tree-empty(TREE)
avl-tree-enter(TREE DATA &optional UPDATEFUN)
avl-tree-first(TREE)
avl-tree-flatten(TREE)
avl-tree-iter(TREE &optional REVERSE)
avl-tree-last(TREE)
avl-tree-map(FUN TREE &optional REVERSE)
avl-tree-mapc(FUN TREE &optional REVERSE)
avl-tree-mapcar(FUN TREE &optional REVERSE)
avl-tree-mapf(FUN COMBINATOR TREE &optional REVERSE)
avl-tree-member(TREE DATA &optional NILFLAG)
avl-tree-member-p(TREE DATA)
avl-tree-p(X)
avl-tree-p--inliner(INLINE--FORM X)
avl-tree-size(TREE)
avl-tree-stack(TREE &optional REVERSE)
avl-tree-stack-empty-p(AVL-TREE-STACK)
avl-tree-stack-first(AVL-TREE-STACK &optional NILFLAG)
avl-tree-stack-p(OBJ)
avl-tree-stack-pop(AVL-TREE-STACK &optional NILFLAG)

Defined faces (0)