摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.题意:给一个二叉树,求出根节点到叶子节点(终端结点)的最短路径解法:使用BFS广度优... 阅读全文
posted @ 2017-07-08 23:32 xiejunzhao 阅读(143) 评论(0) 推荐(0)
摘要: Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are:["1->2->5", "1->3"]# Definition for a binary tree ... 阅读全文
posted @ 2017-07-08 12:25 xiejunzhao 阅读(143) 评论(0) 推荐(0)