Inserts a node into the AVL-tree.
- K_TRUE if inserted. K_FALSE if node exists in tree.
|pRoot ||Pointer to the AVL-tree root structure. |
|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. |