Function to calculate the minimum depth of the tree
int minimumDepth ( Node root , int level ) { if ( root == null ) return level ; level ++ ; return Math . min ( minimumDepth ( root . left , level ) , minimumDepth ( root . right , level ) ) ; }