Binary Search
Crystal_ting
个人博客 limengting.site
展开
-
230. Kth Smallest Element in a BST(Java)
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 total elements.Follow up: What if the BST is mod原创 2017-08-14 22:06:27 · 337 阅读 · 0 评论 -
35. Search Insert Position(Java)
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Here原创 2017-09-25 12:24:53 · 322 阅读 · 0 评论 -
[3]153. Find Minimum in Rotated Sorted Array(Java)
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You may assume no duplicate exist原创 2017-09-22 14:15:57 · 228 阅读 · 0 评论