摘要:
参考例子:[8,3,1,6,4,7,10,14,13] 8,3,1 和 6,4 说明从root开始,沿着左臂向下寻找leaf 的过程中应该逐个将node.val push入ans. 阅读全文
posted @ 2017-01-04 12:11
lettuan
阅读(115)
评论(0)
推荐(0)
摘要:
Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], return [1,3,2]. 本题如果用recursive的方法非 阅读全文
posted @ 2017-01-04 12:00
lettuan
阅读(92)
评论(0)
推荐(0)
摘要:
Given a binary search tree and a node in it, find the in-order successor of that node in the BST. 本题要求查找p在树中的inorder successor(中序遍历时的下一个节点)。根据p和root的关 阅读全文
posted @ 2017-01-04 11:19
lettuan
阅读(140)
评论(0)
推荐(0)
摘要:
验证一个list是不是一个BST的preorder traversal sequence。 Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary sear 阅读全文
posted @ 2017-01-04 06:53
lettuan
阅读(494)
评论(0)
推荐(0)
摘要:
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Note: Given target value is a floati 阅读全文
posted @ 2017-01-04 05:47
lettuan
阅读(251)
评论(0)
推荐(0)

浙公网安备 33010602011771号