Loading...
Engaged employer
Print binary search tree
Anonymous
did they tell in which order you have to print the Binary Search tree ? ...post-order,pre-order ,in-order,level order ?
class Tree { private Node root; public void print() { printRecursively(root); } private void printRecursively(Node node) { if (node == null) return; printRecursively(node.left); System.out.println(node.data); printRecursively(node.right); } }
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalised job recommendations and updates by starting your searches.