随笔分类 -  共同 进步 算法练习篇

LeeCode
摘要:No1 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 i 阅读全文
posted @ 2017-11-13 11:44 不会就问咯 阅读(343) 评论(0) 推荐(0)
摘要://一破题付出血的代价 多思考!public static void offer(int [][]a){ int left=0,right=a.length-1,low=0,high=a[0].length-1; while(low=left;i--){//87 System.out.print(a[high][i]+" "); ... 阅读全文
posted @ 2017-09-16 14:12 不会就问咯 阅读(357) 评论(0) 推荐(0)
摘要:No1 求最大公共子字符串 NO2 找出数组中出现次数超过一半的数(时间复杂度O(n)) 方法一:每次取出两个不同的数,剩下的数字中重复出现的数字肯定比其他数字多,将规模缩小化。如果每次删除两个不同的数(不管包括不包括最高频数),那么在剩余的数字里,原最高频数出现的频率一样超过了50%,不断重复这个 阅读全文
posted @ 2017-09-06 10:44 不会就问咯 阅读(344) 评论(0) 推荐(0)
摘要:No1. Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would ha 阅读全文
posted @ 2017-09-03 05:43 不会就问咯 阅读(620) 评论(0) 推荐(0)