Advertisement
LoganBlackisle

InsertApp

Jun 16th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. package prep_33_binarysearchtrees;
  2.  
  3. public class InsertApp {
  4.  
  5. public static void main(String[] args) {
  6. BST_insertion tree = new BST_insertion();
  7.  
  8. /* Let us create following BST
  9. 50
  10. / \
  11. 30 70
  12. / \ / \
  13. 20 40 60 80 */
  14.  
  15. tree.insert(50);
  16. tree.insert(30);
  17. tree.insert(20);
  18. tree.insert(40);
  19. tree.insert(70);
  20. tree.insert(60);
  21. tree.insert(80);
  22.  
  23. // print inorder traversal of the BST
  24. tree.inorder();
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement