Print binary search tree by levels function implementation
General Notes

Let me preface this section with the fact that I have not looked at Java conventions in a while. Some of these suggestions may stray from classic Java conventions.

With that off my chest, visually your code looks pretty good, though mixture of underscores in your hungarian notation is a little bit odd (Thanks Vogel612).

// Could you not just have 'currentNode.mRightNode'?
if(currentNode.m_RightNode!=null)


You also have several loops or if-statements with only a single line of code in them. This may just be preference, but if you remove the braces in those cases:

if(currNodeHasChild)
{
    q.add(new TreeNode(-1)); // sign of next level
}


becomes

if(currNodeHasChild)
    q.add(new TreeNode(-1)); // sign of next level


which makes the code more compact without reducing readability.



NOTE: When using no-brace notation, only ONE LINE after the if-statement, for-loop, etc. will be considered 'inside' that block of code. As Vogel612 pointed out in a comment below, there have been cases where this notation was misused. Keep an eye out for these bugs, as they can pop up relatively easily. 



One final thing: I do not prefer in-line comments. To my eyes, they break up the flow of the program visually.

BFS Solution

Now onto code improvements.

This problem is built to be solved by recursion. Combining recursion and a breadth-first search yields a relatively simple solution:

public void printTreeByLevels(Queue&lt;TreeNode&gt; nodes, int level)
{
    System.out.println("Level " + level);

    // New queue to hold child nodes
    Queue&lt;TreeNode&gt; newNodes = new ArrayDeque&lt;TreeNode&gt;();

    // Loop through all nodes in the queue
    for(TreeNode node : nodes)
    {
        System.out.println("\t" + node.m_Data);

        // Add child nodes if they exist      
        if(node.m_LeftNode != null)
            newNodes.add(node.m_LeftNode);
        if(node.m_RightNode != null)
            newNodes.add(node.m_RightNode);
    }

    // Call this function again only if one or many child node(s) were found
    if(!newNodes.isEmpty())
        printTreeByLevels(newNodes, level+1);
}


A single for-loop and some if-statements solve this problem quite simply and easily.

NOTE: I originally wrote this in Python as its been a while since I wrote Java. However, the syntax should all be correct.