2017年8月18日

树——binary-tree-maximum-path-sum(二叉树最大路径和)

摘要: 问题: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree, Retu 阅读全文

posted @ 2017-08-18 14:29 一个不会coding的girl 阅读(652) 评论(0) 推荐(0) 编辑

树——sum-root-to-leaf-numbers(根到叶节点数字之和)

摘要: 问题: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2->3whic 阅读全文

posted @ 2017-08-18 13:38 一个不会coding的girl 阅读(454) 评论(0) 推荐(0) 编辑

树——minimum-depth-of-binary-tree(二叉树的最小深度)

摘要: 问题: 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 neares 阅读全文

posted @ 2017-08-18 11:16 一个不会coding的girl 阅读(251) 评论(0) 推荐(0) 编辑

树——binary-tree-postorder-traversal(树的后序遍历)

摘要: 问题: Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree{1,#,2,3}, return[3,2,1]. 递归方法: 非递归方法(利用栈) 阅读全文

posted @ 2017-08-18 10:34 一个不会coding的girl 阅读(332) 评论(0) 推荐(0) 编辑

树——binary-tree-postorder-traversal(树的前序遍历)

摘要: 问题: Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree{1,#,2,3}, return[1,2,3]. 递归方法: 非递归方法(利用栈): 阅读全文

posted @ 2017-08-18 10:00 一个不会coding的girl 阅读(197) 评论(0) 推荐(0) 编辑

导航