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