Implement Balanced Binary Search Tree in C++.

You can implement it as AVL or Red-Black tree. Your tree class BalancedBinarySearchTree should support the following Interfaces:

bool InsertNode(int key) - inserts a node into the tree.
bool DeleteNode(int key) - delete a node with that key;
Node* FindNode(int key) - returns a pointer to the node in the tree.
void PrintLevelKeys() - prints tree node keys using In-Level Traversal (see below).
int GetNodeBalanceProperty() - returns the height or color of a tree.
int Count() - returns number of nodes.

Notes:

Your program should have Node structure/class defined as public.

Implement In-Level traversal algorithm below that will print node keys level by level (remember, meaning of height here is different from height of AVL node) Example: the following tree see image.

should be printed:

20
12 23
11 * 21 30

PrintLevels(root)
Height = GetHeight(root)
For i=1 to Height
PrintLevel(root, i)


PrintLevel(node, level)
If(level == 1)
Print(node.key)
Else
PrintLevel(node->left, level-1)
PrintLevel(node->right, level-1)
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.