int choice=0; BST intTree; do { system("cls"); cout <<"\n================MENU================="; cout <<"\n1. Tao cay nhi phan gom n nut, moi nut luu 1 phan tu cua mang so nguyen cho truoc"; cout <<"\n2. Xuat cay theo thu tu tang dan"; cout <<"\n3. Xuat cay theo thu tu giam dan"; cout <<"\n4. Nut chua khoa X"; cout <<"\n5. Nut co gia tri lon nhat"; cout <<"\n6. Nut co gia tri nho nhat"; cout <<"\n7. Tong cac node tren cay"; cout <<"\n8. Xoa node co gia tri la x"; cout <<"\n9. Thoat"; cout <<"\nNhap lua chon: "; cin>>choice; switch (choice) { case 1:{ int n; cout <<"\nNhap so phan tu cua mang"; cin >>n; int *a=new int[n]; for (int i = 0; i < n; i++) { cout <<"\nx["<>a[i]; intTree.insert(intTree.getRoot(),a[i]); } delete a; break; } case 2:{ cout <<"\n----Xuat theo chieu tang dan----"; intTree.inOrderInCrease(intTree.getRoot()); break; } case 3:{ cout <<"\n----Xuat theo chieu giam dan----"; intTree.inOrderDecrease(intTree.getRoot()); break; } case 4:{ int x; cout <<"\nNhap gia tri x: "; cin>>x; intTree.search(intTree.getRoot(),x); cout <<"\nDa tim thay node co gia tri "; break; } case 5:{ Node *temp=intTree.minValue(intTree.getRoot()); cout <<"\nNode co gia tri nho nhat co gia tri la: \t"<data; break; } case 6:{ Node *temp=intTree.maxValue(intTree.getRoot()); cout <<"\nNode co gia tri nho nhat co gia tri la: \t"<data; break; } case 7:{ cout <<"\nTong cac gia tri cua node la: "<>x; intTree.reMove(intTree.getRoot(),x); cout <<"\nDa xoa thanh cong"; } default: break; } system("pause"); } while (choice !=9);