# Day 23: BST Level-Order Traversal In Java | 30 Days Of Code | Hackerrank Programming Solutions

Hello Programmers/Coders, Today we are going to share solutions of Programming problems of 30 Days Of Code, HackerRank. At Each Problem with Successful submission with all Test Cases Passed, you will get an score or marks. And after solving maximum problems, you will be getting stars. This will highlight your profile to the recruiters.

In this post, you will find the solution for Day 23: BST Level-Order Traversal in Java-HackerRank Problem. We are providing the correct and tested solutions of coding problems present on HackerRank. If you are not able to solve any problem, then you can take help from our Blog/website.

`Use “Ctrl+F” To Find Any Questions Answer. & For Mobile User, You Just Need To Click On Three dots In Your Browser & You Will Get A “Find” Option There. Use These Option to Get Any Random Questions Answer.`

Link for the ProblemDay 23: BST Level-Order Traversal – Hacker Rank Solution

`Day 23: BST Level-Order Traversal – Hacker Rank Solution`

### Problem:

`Day 23: BST Level-Order Traversal – Hacker Rank Solution`
```import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

/**
* @author Techno-RJ
*
*/
public class Day23BSTLevelOrderTraversal {
static class Node {
Node left, right;
int data;

Node(int data) {
this.data = data;
left = right = null;
}
}

static void levelOrder(Node root) {
if (root == null)
System.out.println("nothing to display");
while (!q.isEmpty()) {
Node node = (Node) q.poll();
System.out.print(node.data + " ");
if (node.left != null)
if (node.right != null)

}
}

public static Node insert(Node root, int data) {
if (root == null) {
return new Node(data);
} else {
Node cur;
if (data  0) {
int data = sc.nextInt();
root = insert(root, data);
}
sc.close();
levelOrder(root);
}
}```

Scroll to Top