Longest Increasing Path in a Matrix Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to fo
分类:
编程语言 时间:
2016-02-04 11:29:59
阅读次数:
241
学习动态规划问题(DP问题)中,其中有一个知识点叫最长上升子序列(longest increasing subsequence),也可以叫最长非降序子序列,简称LIS。简单说一下自己的心得。(大神可无视。。) 我们都知道,动态规划的一个特点就是当前解可以由上一个阶段的解推出, 由此,把我们要求的问题
分类:
其他好文 时间:
2016-02-03 22:32:55
阅读次数:
229
https://leetcode.com/problems/longest-substring-without-repeating-characters/ Given a string, find the length of the longest substring without repeati
分类:
其他好文 时间:
2016-02-03 06:39:32
阅读次数:
165
后缀数组的应用。和男人八题那个后缀数组差不多。 1 /* 2890 */ 2 #include <iostream> 3 #include <sstream> 4 #include <string> 5 #include <map> 6 #include <queue> 7 #include <se
分类:
其他好文 时间:
2016-02-03 01:52:15
阅读次数:
215
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22019 Accepted: 12051 Description Some positive integers c
分类:
其他好文 时间:
2016-01-31 13:26:17
阅读次数:
152
计算一个字符串的最长不重复字符串长度 例如abcdcfdgq 截取的是cfdgq 长度为5 1 public int lengthOfLongestSubstring(String s) { 2 if(s == null || s.length() == 0){ 3 return 0; 4 } 5
分类:
其他好文 时间:
2016-01-29 21:04:59
阅读次数:
149
package cn.edu.xidian.sselab.hashtable;import java.util.HashMap;import java.util.HashSet;import java.util.Map;import java.util.Set;/** * * @author zhi
分类:
其他好文 时间:
2016-01-29 00:19:10
阅读次数:
187
Two pointers 配合 HashSet 相当于控制一个小窗,如果下一个字母是新的字母,那小窗就往右移一格,同时检查一下是不是最大长度,如果下一个字母是有重复的,那么就让小窗的左侧往右移动到第一个不是该字母的地方。 需要注意的是,小窗左侧移动的时候,小窗右侧也要往右边移动一次,不然下一轮检查的
分类:
其他好文 时间:
2016-01-28 07:04:43
阅读次数:
118
Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, the...
分类:
其他好文 时间:
2016-01-26 18:38:48
阅读次数:
129
package com.mingxin.leetcode.leet_14;/** * Created by Administrator on 2016/1/25. */public class LongestCommonPrefix { public static void main(Stri...
分类:
其他好文 时间:
2016-01-26 12:19:17
阅读次数:
132