For this Question: Given a Binary Tree, print Right view of it. <b>Right view</b> of a Binary Tree is set of nodes visible when tree is viewed from right side.

Right view of following tree is 1 3 7 8.

          1
       /     \
     2        3
   /   \      /    \
  4     5   6    7
    \
     8<b>Your Task:</b>
This is a function problem. You don't have to take input. Just complete the function <b>rightView()</b> that takes node as parameter and prints the right view. Also the functional part visible to you contains information about the Node class

<b>Constraints:</b>
1 <= T <= 100
1 <= N <= 10^5
1 <= node values <= 10^5

<b>Sum of "N" over all testcases does not exceed 10^5</b>

For <b>Custom Input:</b>
First line of input should contains the number of test cases T. For each test case, there will be two lines of input.
First line contains number of nodes N. Second line will be a string representing the tree as described below: 
The values in the string are in the order of level order traversal of the tree where, numbers denote node values, and a character “N” denotes NULL child.
<b>Note:</b> If a node has been declared Null using 'N', no information about its children will be given further in the array.Print the right view of the binary tree.Sample Input:
2
3
1 3 2
5
10 20 30 40 60

Sample Output:
1 2
10 30 60

Explanation:
Test case 1: Below is the given tree

           1
         /     \
      3        2
For the above test case the right view is: 1 2
Test case 2: Below is the given tree

            10
         /        \
     20          30
   /      \      
40      60

Right View is: 10 30 60., I have written this Solution Code:  private static void printRightView(Node root)  
    { 
        if (root == null) 
            return; 
              
        Queue<Node> queue = new LinkedList<>(); 
        queue.add(root); 
          
        while (!queue.isEmpty())  
        {    
            // number of nodes at current level 
            int n = queue.size(); 
              
            // Traverse all nodes of current level  
            for (int i = 1; i <= n; i++) { 
                Node temp = queue.poll(); 
                  
                // Print the right most element at  
                // the level 
                if (i == n) 
                    System.out.print(temp.data + " "); 
                  
                // Add left node to queue 
                if (temp.left != null) 
                    queue.add(temp.left); 
                      
                // Add right node to queue 
                if (temp.right != null) 
                    queue.add(temp.right); 
            } 
        } 
    } 
  

, In this Programming Language: Java, Now tell me if this Code is compilable or not?