@@ -0,0 +1,1315 @@
+package com.hackerrank.contests.daysOfCode_30;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.Queue;%0Aimport java.util.Scanner;%0A%0A/**%0A * @author manishkumarmdb%0A *%0A */%0A%0Aclass Node23 %7B%0A%09Node23 left, right;%0A%09int data;%0A%0A%09Node23(int data) %7B%0A%09%09this.data = data;%0A%09%09left = right = null;%0A%09%7D%0A%7D%0A%0Apublic class Day23_ReviewBinaryTree %7B%0A%0A%09static void levelOrder(Node23 root) %7B%0A%09%09// Write your code here%0A%0A%09%09Queue%3CNode23%3E queue = new LinkedList%3CNode23%3E();%0A%09%09queue.add(root);%0A%09%09while (!queue.isEmpty()) %7B%0A%09%09%09Node23 tempNode = queue.poll();%0A%09%09%09System.out.printf(%22%25d %22, tempNode.data);%0A%09%09%09if (tempNode.left != null)%0A%09%09%09%09queue.add(tempNode.left);%0A%09%09%09if (tempNode.right != null)%0A%09%09%09%09queue.add(tempNode.right);%0A%09%09%7D%0A%0A%09%7D%0A%0A%09public static Node23 insert(Node23 root, int data) %7B%0A%09%09if (root == null) %7B%0A%09%09%09return new Node23(data);%0A%09%09%7D else %7B%0A%09%09%09Node23 cur;%0A%09%09%09if (data %3C= root.data) %7B%0A%09%09%09%09cur = insert(root.left, data);%0A%09%09%09%09root.left = cur;%0A%09%09%09%7D else %7B%0A%09%09%09%09cur = insert(root.right, data);%0A%09%09%09%09root.right = cur;%0A%09%09%09%7D%0A%09%09%09return root;%0A%09%09%7D%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%0A%09%09@SuppressWarnings(%22resource%22)%0A%09%09Scanner sc = new Scanner(System.in);%0A%09%09int T = sc.nextInt();%0A%09%09Node23 root = null;%0A%09%09while (T-- %3E 0) %7B%0A%09%09%09int data = sc.nextInt();%0A%09%09%09root = insert(root, data);%0A%09%09%7D%0A%09%09levelOrder(root);%0A%0A%09%7D%0A%0A%7D%0A

Create Day23_ReviewBinaryTree.java