1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| void test() { int a[8] = { 5, 3, 7, 2, 4, 6, 8, 9 }; int b[8] = { 5, 3, 7, 2, 4, 6, 8, 15 }; int c[7] = { 5, 3, 7, 2, 4, 6, 8 }; int d[8] = { 5, 3, 7, 2, 4, 6, 8, 1 }; Node<int>* bt1 = CreateBTtree(a, 8); Node<int>* bt2 = CreateBTtree(a, 8); Node<int>* bt3 = CreateBTtree(b, 8); Node<int>* bt4 = CreateBTtree(c, 7); Node<int>* bt5 = CreateBTtree(d, 8); cout << "A and B Equal or Not : " << (isEqual(bt1, bt2) ? "Equal" : "Not Equal") << endl; cout << "A and C Equal or Not : " << (isEqual(bt1, bt3) ? "Equal" : "Not Equal") << endl; cout << "A and D Equal or Not : " << (isEqual(bt1, bt4) ? "Equal" : "Not Equal") << endl; cout << "A and E Equal or Not : " << (isEqual(bt1, bt5) ? "Equal" : "Not Equal") << endl; }
|