摘要: 学习计算机科学已有多年, 目前苦逼读博中,研究机器学习和数据挖掘, 爱好算法和系统。博客园一直是我搜索问题和答案,快速教程的重要来源, 看了很多帖子,受益匪浅。 现在准备工作面试, 特将自己写过的算法代码贴出来,方便自己复习,也希望对别人会有一些帮助,更欢迎大家讨论,指出不足,互相进步。 阅读全文
posted @ 2016-01-20 11:22 nobody2somebody 阅读(76) 评论(0) 推荐(0)
摘要: Q:For a given sorted array (ascending order) and atargetnumber, find the first index of this number inO(log n)time complexity.If the target number doe... 阅读全文
posted @ 2016-01-20 19:12 nobody2somebody 阅读(150) 评论(0) 推荐(0)
摘要: Q:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from... 阅读全文
posted @ 2016-01-20 18:59 nobody2somebody 阅读(137) 评论(0) 推荐(0)
摘要: Q:A: binary search, pay attention to boundary casesjava version 1public class Solution { public int searchInsert(int[] nums, int target) { i... 阅读全文
posted @ 2016-01-20 18:48 nobody2somebody 阅读(116) 评论(0) 推荐(0)
摘要: Q:Given a collection of numbers that might contain duplicates, return all possible unique permutations.A: recursionjava version 1import java.util.Arra... 阅读全文
posted @ 2016-01-20 14:06 nobody2somebody 阅读(91) 评论(0) 推荐(0)
摘要: Q: Given a collection of numbers that might contain duplicates, return all possible unique permutations.A: recursionjava version 1import java.util.Arr... 阅读全文
posted @ 2016-01-20 13:19 nobody2somebody 阅读(109) 评论(0) 推荐(0)
摘要: Leetcode 90 subsets 2, LintcodeQ:Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a sub... 阅读全文
posted @ 2016-01-20 12:59 nobody2somebody 阅读(173) 评论(0) 推荐(0)
摘要: Q:Given a set of distinct integers,nums, return all possible subsets.Note:Elements in a subset must be in non-descending order; The solution set must ... 阅读全文
posted @ 2016-01-20 12:38 nobody2somebody 阅读(124) 评论(0) 推荐(0)
摘要: Leetcode 28Q:Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.A: 本题追求代码简单省额外空间则用nested loop; 追... 阅读全文
posted @ 2016-01-20 11:31 nobody2somebody 阅读(166) 评论(0) 推荐(0)