摘要: Given a range [m, n] where 0 >=1; 7 n>>=1; 8 offset++; 9 }10 return m> 110 n = n >> 111 ... 阅读全文
posted @ 2015-07-01 21:37 tjuloading 阅读(537) 评论(0) 推荐(0)
摘要: Given an integer array of sizen, find all elements that appear more than⌊ n/3 ⌋times. The algorithm should run in linear time and in O(1) space.思路: 【... 阅读全文
posted @ 2015-07-01 20:01 tjuloading 阅读(291) 评论(0) 推荐(0)
摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-07-01 19:44 tjuloading 阅读(339) 评论(0) 推荐(0)