Вы находитесь на странице: 1из 2

Binary Search Tree 1 :- Create 2 Enter your choice the number of nodes the data for node-1 the

data for node-2 the data for node-3 the data for node-4 the data for node-5 :- Insert 3 :- Search :- 1 you want to create :- 5 :- 12 :- 32 :- 44 :- 21 :- 9 4 :- Display

Enter Enter Enter Enter Enter Enter

Do you want to perform more operations ?(y/n) :- y 1 :- Create 2 :- Insert 3 :- Search 4 :- Display Enter your choice :- 4 1 :- Inorder 2 :- Preorder 3 :- Postorder Enter your choice :- 1 9 12 21 32 44 Do you want to continue with display ?(y/n) :- y 1 :- Inorder 2 :- Preorder 3 :- Postorder Enter your choice :- 2 12 9 32 21 44 Do you want to continue with display ?(y/n) :- y 1 :- Inorder 2 :- Preorder 3 :- Postorder Enter your choice :- 3 9 21 44 32 12 Do you want to continue with display ?(y/n) :- n Do you want to perform more operations ?(y/n) :- y 1 :- Create 2 :- Insert 3 :- Search Enter your choice :- 3 Enter the number to be searched :- 123 Number not found. Do you want to perform more operations ?(y/n) :- y 1 :- Create 2 :- Insert 3 :- Search Enter your choice :- 3 Enter the number to be searched :- 44 The number 44 exists in the Tree. Do you want to perform more operations ?(y/n) :- y 1 :- Create 2 :- Insert 3 :- Search Enter your choice :- 2 Enter the data to be inserted :- 8 4 :- Display

4 :- Display

4 :- Display

Do you want to perform more operations ?(y/n) :- y 1 :- Create 2 :- Insert 3 :- Search 4 :- Display Enter your choice :- 4 1 :- Inorder 2 :- Preorder 3 :- Postorder Enter your choice :- 1 8 9 12 21 32 44 Do you want to continue with display ?(y/n) :- n Do you want to perform more operations ?(y/n) :- y 1 :- Create 2 :- Insert 3 :- Search Enter your choice :- 2 Enter the data to be inserted :- 221 Do you want to perform more operations ?(y/n) :- y 1 :- Create 2 :- Insert 3 :- Search Enter your choice :- 2 4 :- Display

4 :- Display

Enter the data to be inserted :- 3 Do you want to perform more operations ?(y/n) :- y 1 :- Create 2 :- Insert 3 :- Search Enter your choice :- 4 1 :- Inorder 2 :- Preorder 3 :- Postorder Enter your choice :- 1 3 8 9 12 21 32 Do you want to continue with display ?(y/n) :- y 1 :- Inorder 2 :- Preorder 3 :- Postorder Enter your choice :- 2 12 9 8 3 32 21 Do you want to continue with display ?(y/n) :- y 1 :- Inorder 2 :- Preorder 3 :- Postorder Enter your choice :- 3 3 8 9 21 221 44 Do you want to continue with display ?(y/n) :- n Do you want to perform more operations ?(y/n) :- n 4 :- Display

44

221

44

221

32

12

Вам также может понравиться