摘要: Get the list of keys in a given binary search tree in a given range[min, max] in ascending order, both min and max are inclusive. Examples 5 / \ 3 8 / 阅读全文
posted @ 2019-01-07 17:26 fatttcat 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the postorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [3,2,1] Follow up: Recursive 阅读全文
posted @ 2019-01-07 15:02 fatttcat 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iterativel 阅读全文
posted @ 2019-01-07 14:11 fatttcat 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2019-01-07 07:52 fatttcat 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses. Now, you are given p 阅读全文
posted @ 2019-01-07 04:53 fatttcat 阅读(178) 评论(0) 推荐(0) 编辑