leetcode 111 Minimum Depth of Binary Tree 详细解答

leetcode 111 Minimum Depth of Binary Tree 详细解答
解法1
在这里用BFS,类似层序遍历。队列存储的是节点和层数。出口就是当一个节点既没有左子树也没有右子树。
代码如下:
leetcode 111 Minimum Depth of Binary Tree 详细解答

相关文章:

  • 2022-12-23
  • 2021-09-23
  • 2021-08-14
  • 2021-09-17
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2021-04-17
  • 2021-08-21
  • 2021-11-02
  • 2021-06-09
  • 2022-12-23
相关资源
相似解决方案