An AVL Tree [G. M. Adel'son-Vel'skii and E. M. Landis, Soviet Math. 3, 1259-1263, 1962; D. Knuth, The Art of Computer Programming, vol. 3: Sorting and Searching, Addison-Wesley, 1973, section 6.2.3.] is a binary tree that is approximately height-balanced: left and right subtrees of any node differ in height by at most 1.
Advantage: approximately O(log(n)) search and insert time.
Disadvantage: complex code (120 - 200 lines).
will generate AVL programs in your choice of language.
Contents    Page-10    Prev    Next    Page+10    Index