public static int getDepth(TreeNode root){
        if(root == null){
            return 0;
        }
        int treeDepth = 0;
        int curLevelCount = 1;
        int nextLevelCount = 0;

        Queue<TreeNode> queue = new LinkedList<TreeNode>();
        queue.add(root);

        while (!queue.isEmpty()){
            TreeNode tmpNode = queue.remove();
            curLevelCount--;
            if(tmpNode.leftNode != null){
                nextLevelCount++;
                queue.add(tmpNode.leftNode);
            }
            if(tmpNode.rightNode != null){
                nextLevelCount++;
                queue.add(tmpNode.rightNode);
            }
            if(curLevelCount == 0){
                treeDepth++;
                curLevelCount = nextLevelCount;
                nextLevelCount = 0;
            }
        }
        return treeDepth;

    }