摘要: You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the w 阅读全文
posted @ 2017-06-04 09:41 CodesKiller 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th 阅读全文
posted @ 2017-06-04 08:30 CodesKiller 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc 阅读全文
posted @ 2017-06-03 07:03 CodesKiller 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x, n). 阅读全文
posted @ 2017-05-27 02:58 CodesKiller 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given an array of n distinct non-empty strings, you need to generate minimal possible abbreviations for every word following rules below. Example: Not 阅读全文
posted @ 2017-05-26 07:18 CodesKiller 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. 阅读全文
posted @ 2017-05-26 02:46 CodesKiller 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According 阅读全文
posted @ 2017-05-25 08:54 CodesKiller 阅读(183) 评论(0) 推荐(0) 编辑
摘要: A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h 阅读全文
posted @ 2017-05-25 00:55 CodesKiller 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 阅读全文
posted @ 2017-05-20 02:42 CodesKiller 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 算法原理 桶排序 (Bucket sort)或所谓的箱排序的原理是将数组分到有限数量的桶子里,然后对每个桶子再分别排序(有可能再使用别的排序算法或是以递归方式继续使用桶排序进行排序),最后将各个桶中的数据有序的合并起来。 排序过程: Data Structure Visualizations 提供了 阅读全文
posted @ 2017-05-20 01:59 CodesKiller 阅读(237) 评论(0) 推荐(0) 编辑