write min depth of binary tree