Exemplo n.º 1
0
void Test1(BinarySearchTree<int> &tree) {
    tree.Print();
    if (!IsBalanced(tree.GetRoot()))
        printf("Not balanced\n");
    else
        printf("Balanced\n");
}
Exemplo n.º 2
0
void Test(BinarySearchTree<int> &tree) {
    tree.Print();
    if (GetBalancedTreeHeight(tree.GetRoot()) == -1)
        printf("Not balanced\n");
    else
        printf("Balanced\n");
}