E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
LeetCode解题
LeetCode Integer to Roman
LeetCode解题
之IntegertoRoman原题将一个int型的数字转化为罗马数字,范围在1-3999。
u013291394
·
2015-12-18 10:00
LeetCode
算法
python
罗马数字
LeetCode Regular Expression Matching
LeetCode解题
之RegularExpressionMatching原题简易版正则表达式匹配,只有两种通配符,”.”表示任意一个字符,”c*”表示字符c可以有零个或多个。
u013291394
·
2015-12-17 20:00
LeetCode
算法
python
正则表达式
动态规划
LeetCode Container With Most Water
LeetCode解题
之ContainerWithMostWater原题给定一组长短不一的隔板,挑其中的两块板,使得板子之间能装最多的水。
u013291394
·
2015-12-17 14:00
LeetCode
算法
python
最优解
LeetCode Palindrome Number
LeetCode解题
之PalindromeNumber原题判断一个int型数字是否是回文形式,不许用额外的空间。
u013291394
·
2015-12-16 12:00
LeetCode
算法
python
回文
palindrome
LeetCode String to Integer
LeetCode解题
之StringtoInteger原题讲一个字符串转化成int类型。
u013291394
·
2015-12-16 11:00
LeetCode
算法
python
atoi
LeetCode Reverse Integer
LeetCode解题
之ReverseInteger原题翻转一个intger类型的数字。
u013291394
·
2015-12-15 16:00
LeetCode
算法
LeetCode ZigZag Conversion
LeetCode解题
之ZigZagConversion原题将所给字符串按特定形状排列,依次将每排的字符连接形成新的字符串。
u013291394
·
2015-12-15 16:00
LeetCode
算法
排序
python
LeetCode Longest Palindromic Substring
LeetCode解题
之LongestPalindromicSubstring原题找到一个字符串的最长回文子字符串,该字符串长度不超过1000,且只有唯一一个最长回文子串。
u013291394
·
2015-12-14 21:00
LeetCode
算法
python
回文
palindrom
LeetCode Median of Two Sorted Arrays
LeetCode解题
之MedianofTwoSortedArrays原题给两个整型的有序数组,要求找出这两个数组中的中位数,时间复杂度为O(log(m+n))。
u013291394
·
2015-12-13 20:00
LeetCode
算法
python
中位数
LeetCode Longest Substring Without Repeating Characters
LeetCode解题
之LongestSubstringWithoutRepeatingCharacters原题找出一个字符串的最长字符串,要求该字符串中没有重复的字符。
u013291394
·
2015-12-13 19:00
LeetCode
算法
python
子字符串
LeetCode Add Two Numbers
LeetCode解题
之AddTwoNumbers原题定义这样的一个链表,链表的每个节点都存有一个0-9的数字,把链表当成数字,表头为高位,表尾为地位。
u013291394
·
2015-12-11 22:00
LeetCode
算法
python
链表
加法
LeetCode Two Sum
LeetCode解题
之TwoSum原题给一个int型数组,要求找出其中两个和为特定值的数的坐标。
u013291394
·
2015-12-11 21:00
LeetCode
算法
python
求和
LeetCode解题
报告--Search Insert Position
题目:Givenasortedarrayandatargetvalue,returntheindexifthetargetisfound.Ifnot,returntheindexwhereitwouldbeifitwereinsertedinorder.Youmayassumenoduplicatesinthearray.Herearefewexamples.[1,3,5,6],5→2[1,3,5
YatKam
·
2015-12-04 16:11
LeetCode解题报告
算法
python学习
java
LeetCode
解题报告
leetcode
java
python
算法
刷题
Distinct Subsequences
LeetCode:Distinct Subsequences 我的
LeetCode解题
报告索引 题目链接 Given a string S and a string 
·
2015-11-13 22:09
LeetCode
LeetCode解题
报告:Linked List Cycle && Linked List Cycle II
Linked List Cycle Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? Linked List Cycle II Given a linked list, return the node
·
2015-11-12 22:19
LeetCode
LeetCode解题
报告:Reorder List
Reorder List Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example,Given&
·
2015-11-12 22:18
LeetCode
LeetCode解题
报告:Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. No
·
2015-11-12 22:17
LeetCode
LeetCode解题
报告:Insertion Sort List
Insertion Sort List Sort a linked list using insertion sort. leetcode subject思路:标准的插入排序。考察一下链表的操作。 对链表进行插入排序的正确方法是:新建一个头节点,遍历原来的链表,对原链表的每个节点找到新链表中适合插入位置的前指针,然后执行插入操作。这种操作链表的题的技巧是:新建一个dummy作为head n
·
2015-11-12 22:16
LeetCode
LeetCode解题
报告:LRU Cache
LRU Cache Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will a
·
2015-11-12 22:16
LeetCode
leetcode解题
—Longest Palindromic Substring
题目: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 解题:参考网上大神做法,
·
2015-10-31 19:01
substring
LeetCode:Distinct Subsequences
我的
LeetCode解题
报告索引 题目链接 Given a string S and a string T, count the number of distinct
·
2015-10-27 11:29
LeetCode
leetCode解题
报告5道题(九)
题目一:Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a so
·
2015-10-23 08:16
LeetCode
LeetCode解题
报告--2Sum, 3Sum, 4Sum, K Sum求和问题总结
前言:这几天在做LeetCode里面有2sum,3sum(closest),4sum等问题,这类问题是典型的递归思路解题,该这类问题的关键在于,在进行求和求解前,要先排序Arrays.sort()可实现,而本文则着重探讨关于KSum问题。leetcode求和问题描述(Ksumproblem):Ksum的求和问题一般是这样子描述的:给你一组N个数字(比如vectornum),然后给你一个常数(比如i
YatKam
·
2015-08-17 18:02
算法
java
LeetCode解题报告
LeetCode
解题报告
leetcode解题
系列:翻转数组
Q:Problem:Rotateanarrayofnelementstotherightbyksteps.Forexample,withn=7andk=3,thearray[1,2,3,4,5,6,7]isrotatedto[5,6,7,1,2,3,4].Howmanydifferentwaysdoyouknowtosolvethisproblem?a:1、firstmethod:新建一个数组,将
行者路上
·
2015-07-23 11:30
算法
Leetcode难度表及解题汇总
IdQuestionDifficultyFrequencyDataStructuresAlgorithmsBlogComment1TwoSum25array+setsort+2ptr2AddTwoNumbers34linkedlistmath+2ptr
Leetcode
dc_726
·
2015-05-08 22:00
LeetCode
Algorithm
leetcode解题
报告:Interleaving String
问题描述:给定两个字符串s1,s2,判断字符串s3是否是由s1、s2交错构成。例子:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac",returntrue.When s3 = "aadbbbaccc",returnfalse.思路:代码:Python
金瑛棋
·
2015-04-01 18:43
LeetCode
leetcode解题
报告:121 Best Time to Buy and Sell Stock
问题:给定一个列表,第i个元素代表股票第i天的价值,只允许买入卖出一次,求最大收益思路:动态规划开始没想清楚,觉着遍历一次找出最大与最小股价求差就是,后来发现脑子绣住了,买入要在买出之前。输入为列表p1p2...pmm[i]表示前i天的最小股价,m[i]=min(p[i],m[i-1])i>=1<--O(n)时间开销第i天卖出的最大收益是pi-m[i-1]<--遍历一次O(n)求出最大值 代码:P
金瑛棋
·
2015-04-01 15:39
LeetCode
leetcode解题
报告:121 Best Time to Buy and Sell Stock
问题:给定一个列表,第i个元素代表股票第i天的价值,只允许买入卖出一次,求最大收益思路:动态规划开始没想清楚,觉着遍历一次找出最大与最小股价求差就是,后来发现脑子绣住了,买入要在买出之前。输入为列表p1p2...pmm[i]表示前i天的最小股价,m[i]=min(p[i],m[i-1])i>=1<--O(n)时间开销第i天卖出的最大收益是pi-m[i-1]<--遍历一次O(n)求出最大值代码:Py
金瑛棋
·
2015-04-01 15:39
leetcode
leetcode解题报告
leetcode解题
报告:198 House Robber
问题描述:一个小偷去一个街区偷东西,求偷得价值最大,唯一限制就是不能偷连续的两家,因为这样会触发警报。建模:给定一个列表,里面存着每家可以偷的价值,输出最大偷到的价值。思路:动态规划如果输入是v1v2...vm,用S[i]表示从v1v2...vi能偷到的最大价值。递归子问题:S[i]=max(S[i-1],vi+S[i-2])初如条件:S[0]=0S[1]=v1S[2]=max(S[1],v2+S
金瑛棋
·
2015-04-01 14:28
LeetCode
leetcode解题
报告:198 House Robber
问题描述:一个小偷去一个街区偷东西,求偷得价值最大,唯一限制就是不能偷连续的两家,因为这样会触发警报。建模:给定一个列表,里面存着每家可以偷的价值,输出最大偷到的价值。思路:动态规划如果输入是v1v2...vm,用S[i]表示从v1v2...vi能偷到的最大价值。递归子问题:S[i]=max(S[i-1],vi+S[i-2])初如条件:S[0]=0S[1]=v1S[2]=max(S[1],v2+S
金瑛棋
·
2015-04-01 14:28
LeetCode
leetcode解题
报告:198 House Robber
问题描述:一个小偷去一个街区偷东西,求偷得价值最大,唯一限制就是不能偷连续的两家,因为这样会触发警报。建模:给定一个列表,里面存着每家可以偷的价值,输出最大偷到的价值。思路:动态规划如果输入是v1v2...vm,用S[i]表示从v1v2...vi能偷到的最大价值。递归子问题:S[i]=max(S[i-1],vi+S[i-2])初如条件:S[0]=0S[1]=v1S[2]=max(S[1],v2+S
金瑛棋
·
2015-04-01 14:28
leetcode
leetcode解题报告
leetcode解题
报告:121 Best Time to Buy and Sell Stock
问题:给定一个列表,第i个元素代表股票第i天的价值,只允许买入卖出一次,求最大收益思路:动态规划开始没想清楚,觉着遍历一次找出最大与最小股价求差就是,后来发现脑子绣住了,买入要在买出之前。输入为列表p1p2...pmm[i]表示前i天的最小股价,m[i]=min(p[i],m[i-1])i>=1<--O(n)时间开销第i天卖出的最大收益是pi-m[i-1]<--遍历一次O(n)求出最大值 代码:P
金瑛棋
·
2015-04-01 08:16
LeetCode
leetcode解题
报告:121 Best Time to Buy and Sell Stock
问题:给定一个列表,第i个元素代表股票第i天的价值,只允许买入卖出一次,求最大收益思路:动态规划开始没想清楚,觉着遍历一次找出最大与最小股价求差就是,后来发现脑子绣住了,买入要在买出之前。输入为列表p1p2...pmm[i]表示前i天的最小股价,m[i]=min(p[i],m[i-1])i>=1<--O(n)时间开销第i天卖出的最大收益是pi-m[i-1]<--遍历一次O(n)求出最大值代码:Py
金瑛棋
·
2015-04-01 08:16
leetcode
leetcode解题
报告:198 House Robber
问题描述:一个小偷去一个街区偷东西,求偷得价值最大,唯一限制就是不能偷连续的两家,因为这样会触发警报。建模:给定一个列表,里面存着每家可以偷的价值,输出最大偷到的价值。思路:动态规划如果输入是v1v2...vm,用S[i]表示从v1v2...vi能偷到的最大价值。递归子问题:S[i]=max(S[i-1],vi+S[i-2])初如条件:S[0]=0S[1]=v1S[2]=max(S[1],v2+S
金瑛棋
·
2015-04-01 07:27
LeetCode
leetcode解题
报告:198 House Robber
问题描述:一个小偷去一个街区偷东西,求偷得价值最大,唯一限制就是不能偷连续的两家,因为这样会触发警报。建模:给定一个列表,里面存着每家可以偷的价值,输出最大偷到的价值。思路:动态规划如果输入是v1v2...vm,用S[i]表示从v1v2...vi能偷到的最大价值。递归子问题:S[i]=max(S[i-1],vi+S[i-2])初如条件:S[0]=0S[1]=v1S[2]=max(S[1],v2+S
金瑛棋
·
2015-04-01 07:27
leetcode
leetcode解题
报告:198 House Robber
问题描述:一个小偷去一个街区偷东西,求偷得价值最大,唯一限制就是不能偷连续的两家,因为这样会触发警报。建模:给定一个列表,里面存着每家可以偷的价值,输出最大偷到的价值。思路:动态规划如果输入是v1v2...vm,用S[i]表示从v1v2...vi能偷到的最大价值。递归子问题:S[i]=max(S[i-1],vi+S[i-2])初如条件:S[0]=0S[1]=v1S[2]=max(S[1],v2+S
金瑛棋
·
2015-04-01 07:27
LeetCode
leetcode解题
报告:44 Wildcard Matching
问题描述:给定字符串s与模式串p,其中p中的'?'可以匹配任意单个字符,'*'可以匹配任意字符串(包括空串),判断模式串是否匹配字符s全部(不是部分)。例子:isMatch("aa","a")→falseisMatch("aa","aa")→trueisMatch("aaa","aa")→falseisMatch("aa","*")→trueisMatch("aa","a*")→trueisMat
金瑛棋
·
2015-03-30 23:23
LeetCode
leetcode解题
报告:44 Wildcard Matching
问题描述:给定字符串s与模式串p,其中p中的'?'可以匹配任意单个字符,'*'可以匹配任意字符串(包括空串),判断模式串是否匹配字符s全部(不是部分)。例子:isMatch("aa","a")→falseisMatch("aa","aa")→trueisMatch("aaa","aa")→falseisMatch("aa","*")→trueisMatch("aa","a*")→trueisMat
金瑛棋
·
2015-03-30 23:23
LeetCode
leetcode解题
报告:44 Wildcard Matching
问题描述:给定字符串s与模式串p,其中p中的'?'可以匹配任意单个字符,'*'可以匹配任意字符串(包括空串),判断模式串是否匹配字符s全部(不是部分)。例子:isMatch("aa","a")→falseisMatch("aa","aa")→trueisMatch("aaa","aa")→falseisMatch("aa","*")→trueisMatch("aa","a*")→trueisMat
金瑛棋
·
2015-03-30 23:23
leetcode
leetcode解题报告
leetcode解题
报告:10 Regular Expression Matching
问题描述:给定字符串s与模式串p,其p中'.'可以匹配s中任意字符,'*'可以匹配0个或者任意多个之前字符,判断模式串p是否匹配全部字符串s(不是部分)。例子:isMatch("aa","a")→falseisMatch("aa","aa")→trueisMatch("aaa","aa")→falseisMatch("aa","a*")→trueisMatch("aa",".*")→trueisM
金瑛棋
·
2015-03-30 22:27
LeetCode
leetcode解题
报告:10 Regular Expression Matching
问题描述:给定字符串s与模式串p,其p中'.'可以匹配s中任意字符,'*'可以匹配0个或者任意多个之前字符,判断模式串p是否匹配全部字符串s(不是部分)。例子:isMatch("aa","a")→falseisMatch("aa","aa")→trueisMatch("aaa","aa")→falseisMatch("aa","a*")→trueisMatch("aa",".*")→trueisM
金瑛棋
·
2015-03-30 22:27
LeetCode
Leetcode解题
-链表(2.2.6)RotateList
1 题目:RotateListGivenalist,rotatethelisttotherightbykplaces,wherekisnon-negative.Forexample:Given1->2->3->4->5->nullptrandk=2,return4->5->1->2->3->nullptr.2 实现首先确定题目要求的旋转都需要哪些结点:dummy头结点、结点K、尾结点,然后再去定位
dc_726
·
2015-03-28 11:00
LeetCode
Algorithm
Leetcode解题
-树(5.0.0)基础类
与第二章类似,LeetCode指定了TreeNode实现。为了方便后续习题的编写和测试,创建一个基础父类,包含TreeNode实现,以及create()和print()创建和打印树的方法。其中create()采用类似“堆”的方式,用数组表示树形结构,复习一下,左右子结点就是2*i和2*i+1。而print()方法采用前序遍历的方式,通过额外一个参数level确定当前结点的深度,从而打印一些制表符或
dc_726
·
2015-03-28 11:00
Algorithm
LeetCode
Leetcode解题
-链表(2.2.3)PartitionList
题目:2.2.3PartitionListGivenalinkedlistandavaluex,partitionitsuchthatallnodeslessthanxcomebeforenodesgreaterthanorequaltox.Youshouldpreservetheoriginalrelativeorderofthenodesineachofthetwopartitions.For
dc_726
·
2015-03-28 11:00
LeetCode
Algorithm
链表
Leetcode解题
-链表(2.2.2)ReverseLinkedList
题目:2.2.2ReverseLinkedListIIReversealinkedlistfrompositionmton.Doitin-placeandinone-pass.Forexample:Given1->2->3->4->5->nullptr,m=2andn=4,return1->4->3->2->5->nullptr.Note:Givenm,nsatisfythefollowingco
dc_726
·
2015-03-28 11:00
Algorithm
链表
Leetcode解题
-链表(2.2.1)AddTwoNumbers
1 题目:2.2.1AddTwoNumbersYouaregiventwolinkedlistsrepresentingtwonon-negativenumbers.Thedigitsarestoredinreverseorderandeachoftheirnodescontainasingledigit.Addthetwonumbersandreturnitasalinkedlist.Input
dc_726
·
2015-03-28 08:00
Algorithm
算法
Leetcode解题
-链表(2.2.0)基础类
1 基类的作用在开始练习LeetCode链表部分的习题之前,首先创建好一个Solution基类,其作用就是:Ø 规定好每个子Solution都要实现纯虚函数test做测试;Ø 提供了ListNode结构的定义;Ø create函数创建链表;Ø print打印链表等工具函数;从而方便我们编写完算法函数后进行单元测试。2 代码实现因为我们提供的链表仅是用来完成后面的习题,而不用提供增删改查等操
dc_726
·
2015-03-28 08:00
[LeetCode]Surrounded Regions,解题报告
昨晚终于熬夜搞定,补充一道
LeetCode解题
报告。
zinss26914
·
2015-03-20 20:00
DFS
bfs
Lee
leetcode解题
目录
点击打开链接点击打开链接点击打开链接参考文献:http://blog.csdn.net/lanxu_yy/article/details/17848219 不过本文准备用超链接的方式连接到相应解答页面,不断更新中题目算法数据结构注意事项CloneGraphBFS哈希表WordLadder BFS哈希表WordLadderIIBFS哈希表SurroundedRegionsBFS矩阵BinaryTre
fangjian1204
·
2014-08-11 08:00
LeetCode
数据结构
算法
LRU算法&&
LeetCode解题
报告
题目DesignandimplementadatastructureforLeastRecentlyUsed(LRU)cache.Itshouldsupportthefollowingoperations:getandset. get(key)-Getthevalue(willalwaysbepositive)ofthekeyifthekeyexistsinthecache,otherwisere
zinss26914
·
2014-06-23 00:00
上一页
5
6
7
8
9
10
11
12
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他