摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文
posted @ 2015-10-29 06:09 fenshen371 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路:分治。将当前区间的中点给当前node,然后左区间中点为left,右区间中点为right。以下为AC代... 阅读全文
posted @ 2015-10-29 05:33 fenshen371 阅读(145) 评论(0) 推荐(0) 编辑