Inserts a node into the AVL-tree.
- TRUE if inserted. FALSE if node exists in tree.
|ppTree ||Pointer to the AVL-tree root node pointer. |
|pNode ||Pointer to the node which is to be added. Find the location of the node (using binary tree algorithm.): LOOP until NULL leaf pointer BEGIN Add node pointer pointer to the AVL-stack. IF new-node-key < node key THEN left ELSE right END Fill in leaf node and insert it. Rebalance the tree. |