摘要: 在处理一道题目是,发现他们使用了List 中的set 方法,这个方法我平时很少用到,今天来研究一下,set和add的区别 add(int index,Object obj)方法与set(int index,Object e) 我们写一个例子: 结果: 阅读全文
posted @ 2016-11-18 11:47 破玉 阅读(5718) 评论(0) 推荐(1) 编辑
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2016-11-18 11:10 破玉 阅读(292) 评论(0) 推荐(0) 编辑