c++ program to Implementation of an AVL tree
08:17Implementation of an AVL tree
OUTPUT:
1)Create :
2)Insert :
3)Delete :
4)Print :
5)Quit :
Enter Your Choice : 1
Enter no.of elements :10
Enter tree data :1 2 4 6 8 3 5 9 7 11
1)Create :
2)Insert :
3)Delete :
4)Print :
5)Quit :
Enter Your Choice : 4
Preorder sequence :
4(Bf=-1) 2(Bf=0) 1(Bf=0) 3(Bf=0) 8(Bf=0) 6(Bf=0) 5(Bf=0) 7(Bf=0) 9(Bf=-1) 11(Bf=0)
Inorder sequence :
1(Bf=0) 2(Bf=0) 3(Bf=0) 4(Bf=-1) 5(Bf=0) 6(Bf=0) 7(Bf=0) 8(Bf=0) 9(Bf=-1) 11(Bf=0)
1)Create :
2)Insert :
3)Delete :
4)Print :
5)Quit :
Enter Your Choice : 3
Enter a data : 4
1)Create :
2)Insert :
3)Delete :
4)Print :
5)Quit :
Enter Your Choice : 4
Preorder sequence :
5(Bf=-1) 2(Bf=0) 1(Bf=0) 3(Bf=0) 8(Bf=0) 6(Bf=-1) 7(Bf=0) 9(Bf=-1) 11(Bf=0)
Inorder sequence :
1(Bf=0) 2(Bf=0) 3(Bf=0) 5(Bf=-1) 6(Bf=-1) 7(Bf=0) 8(Bf=0) 9(Bf=-1) 11(Bf=0)
1)Create :
2)Insert :
3)Delete :
4)Print :
5)Quit :
Enter Your Choice : 2
Enter a data : 4
1)Create :
2)Insert :
3)Delete :
4)Print :
5)Quit :
Enter Your Choice : 5
A better program for AVL tree implementation
ReplyDelete