摘要: LRU Cache 这题调了好几天才pass 要点:用doubly linked list, deleteNode和addNode分开考虑,分开考虑,分开考虑,重要的事情说三遍 需要dummy node和tail,deleteNode考虑tail,addNode考虑dummy.next(因为addN 阅读全文
posted @ 2016-05-17 10:41 absolute100 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Find Minimum in Rotated Sorted Array II, Search in Rotated Sorted Array II: 注意这两题都是对nums[mid]和nums[low]进行if...elif...else分支而不是nums[low]和nums[high],这几题 阅读全文
posted @ 2016-05-17 10:38 absolute100 阅读(77) 评论(0) 推荐(0) 编辑
摘要: Find Minimum in Rotated Sorted Array 要点:low=nums[low]: low = mid+1 else: high = mid return nums[mid] ``` 阅读全文
posted @ 2016-05-17 10:36 absolute100 阅读(81) 评论(0) 推荐(0) 编辑