@@ -0,0 +1,1190 @@
+import java.util.LinkedList;%0Aimport java.util.Scanner;%0A%0Aclass Node %7B%0A%0A%09Node left, right;%0A%09int data;%0A%0A%09Node( int data ) %7B%0A%09%09this.data = data;%0A%09%09left = right = null;%0A%09%7D%0A%0A%7D%0A%0Apublic class Solution %7B%0A%0A%09public static LinkedList%3CNode%3E queue = new LinkedList%3C%3E();%0A%0A%09public static void main( String args%5B%5D ) %7B%0A%0A%09%09Scanner sc = new Scanner( System.in );%0A%09%09int T = sc.nextInt();%0A%09%09Node 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%09sc.close();%0A%0A%09%7D%0A%0A%09public static Node insert( Node root, int data ) %7B%0A%0A%09%09if ( root == null ) %7B%0A%09%09%09return new Node( data );%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09Node 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%0A%09%09%09else %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%0A%09%7D%0A%0A%09public static void levelOrder( Node root ) %7B%0A%0A%09%09if ( root == null ) %7B%0A%09%09%09return;%0A%09%09%7D%0A%0A%09%09queue.add( root );%0A%0A%09%09while ( !queue.isEmpty() ) %7B%0A%09%09%09Node tmp = queue.removeFirst();%0A%09%09%09System.out.print( tmp.data + %22 %22 );%0A%0A%09%09%09if ( tmp.left != null ) %7B%0A%09%09%09%09queue.add( tmp.left );%0A%09%09%09%7D%0A%0A%09%09%09if ( tmp.right != null ) %7B%0A%09%09%09%09queue.add( tmp.right );%0A%09%09%09%7D%0A%0A%09%09%7D%0A%0A%09%7D%0A%7D%0A

Add day 23 solution