上一页 1 2 3 4 5 6 7 ··· 37 下一页
摘要: 背景QAQ 最近在准备找工作,以前就听说过并查集,一直没有深入了解,今天就仔细分析一下并查集,如果有漏洞请多多指教 概念 并查集就是一种树形结构,主要是用来处理一些不相交集合的合并及查询问题。 那么是怎么处理的呢。 首先要求集合中的元素不相同,其次要求可以识别出某个集合。这就需要我们找出一个集合中的 阅读全文
posted @ 2018-07-29 12:22 immjc 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 描述 描述 给出两个单词word1和word2,计算出将word1 转换为word2的最少操作次数。 你总共三种操作方法: 插入一个字符 删除一个字符 替换一个字符 动态规划问题, 当进行一步操作后,将A[2...lenA] B[2...lenB]变成相等字符串 当进行一步操作后,将A[1...le 阅读全文
posted @ 2018-07-25 11:15 immjc 阅读(207) 评论(0) 推荐(0) 编辑
摘要: A sequence X_1, X_2, ..., X_n is fibonacci-like if: n >= 3 X_i + X_{i+1} = X_{i+2} for all i + 2 <= n Given a strictly increasing array A of positive 阅读全文
posted @ 2018-07-24 21:39 immjc 阅读(582) 评论(0) 推荐(0) 编辑
摘要: 给出三个字符串:s1、s2、s3,判断s3是否由s1和s2交叉构成。 给出三个字符串:s1、s2、s3,判断s3是否由s1和s2交叉构成。 给出三个字符串:s1、s2、s3,判断s3是否由s1和s2交叉构成。 给出三个字符串:s1、s2、s3,判断s3是否由s1和s2交叉构成。 样例 比如 s1 = 阅读全文
posted @ 2018-07-24 17:43 immjc 阅读(287) 评论(0) 推荐(0) 编辑
摘要: The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following seque 阅读全文
posted @ 2018-07-20 15:27 immjc 阅读(108) 评论(0) 推荐(0) 编辑
摘要: The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following seque 阅读全文
posted @ 2018-07-20 15:27 immjc 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
posted @ 2018-07-20 12:35 immjc 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: 最长回文字串 回文字符串 阅读全文
posted @ 2018-07-12 20:33 immjc 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2018-07-12 18:11 immjc 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" Example 2: Input: [ 阅读全文
posted @ 2018-07-12 16:38 immjc 阅读(112) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 37 下一页