上一页 1 2 3 4 5 6 7 8 ··· 23 下一页
摘要: You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve 阅读全文
posted @ 2017-03-22 09:33 CodesKiller 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2017-03-22 07:37 CodesKiller 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2017-03-22 06:07 CodesKiller 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2017-03-22 05:54 CodesKiller 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1:Input: Output 阅读全文
posted @ 2017-03-22 02:58 CodesKiller 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 递归的基本概念:程序调用自身的编程技巧称为递归,是函数自己调用自己. 一个函数在其定义中直接或间接调用自身的一种方法,它通常把一个大型的复杂的问题转化为一个与原问题相似的规模较小的问题来解决,可以极大的减少代码量.递归的能力在于用有限的语句来定义对象的无限集合. 使用递归要注意的有两点: 1)递归就 阅读全文
posted @ 2017-03-22 02:56 CodesKiller 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + 阅读全文
posted @ 2017-03-22 01:49 CodesKiller 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 快速选择算法,是一种能在大致O(N)的时间内选取数组中第k大或者k小的算法.其基本思路与快速排序算法类似,也是分治的思想. 其实这个算法是个基础算法,但是不常用,所以今天编的时候错了POJ2388,才有了这篇文章. 下面几段代码,尤其要注意的是 while(i<j) 还是 while(i<=j) 程 阅读全文
posted @ 2017-03-21 08:16 CodesKiller 阅读(5157) 评论(0) 推荐(0) 编辑
摘要: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam 阅读全文
posted @ 2017-03-21 07:56 CodesKiller 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2]. Note: You may assum 阅读全文
posted @ 2017-03-21 06:25 CodesKiller 阅读(152) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 23 下一页