public static int getNodeNum(TreeNode root){
        if(root == null){
            return 0;
        }
        int nodeCount = 0;
        Queue<TreeNode> queue = new LinkedList<TreeNode>();
        queue.add(root);
        nodeCount++;

        while (!queue.isEmpty()){
            TreeNode tmpNode = queue.remove();
            if(tmpNode.leftNode != null){
                nodeCount++;
                queue.add(tmpNode.leftNode);
            }
            if(tmpNode.rightNode != null){
                nodeCount++;
                queue.add(tmpNode.rightNode);
            }
        }
        return nodeCount;

    }