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解题
报告5道题(十)
题目一:ValidNumberValidateifagivenstringisnumeric.Someexamples:"0" => true"0.1" => true"abc" => false"1a" => false"2e10" => trueNote: Itisintendedfortheproblemstatementtobeambiguous.Youshouldgatherallreq
u011133213
·
2014-05-19 01:00
SUM
in
number
Path
game
game
rectangle
valid
II
Minimum
JUMP
JUMP
Histogr
leetCode解题
报告5道题(九)
题目一:CombinationsGiventwointegers n and k,returnallpossiblecombinationsof k numbersoutof1... n.Forexample,If n =4and k =2,asolutionis:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ]分析:题意给我们一个数字n,和一个数字k,让
u011133213
·
2014-05-18 09:00
list
String
list
partition
search
Matrix
rotate
2d
a
combinations
Scramble
leetCode解题
报告5道题(八)
题目一:PopulatingNextRightPointersinEachNode GivenabinarytreestructTreeLinkNode{ TreeLinkNode*left; TreeLinkNode*right; TreeLinkNode*next; } Populateeachnextpointertopointtoitsnextrightnode.Ifthereisnone
u011133213
·
2014-05-15 14:00
LeetCode
right
next
II
Pascals
Triangle
Triangle
Pascals
Triangle
Pointers
leetCode解题
报告5道题(七)
题目一:InterleavingStringGiven s1, s2, s3,findwhether s3 isformedbytheinterleavingof s1 and s2.Forexample,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac",returntrue.When s3 = "aadbbbaccc",returnfa
u011133213
·
2014-05-14 10:00
String
validate
binary
binary
recover
Stairs
Interleaving
Climbing
Searc
Sqrtx
Sear
leetCode解题
报告5道题(六)
题目一:LongestSubstringWithoutRepeatingCharacters Givenastring,findthelengthofthelongestsubstringwithoutrepeatingcharacters.Forexample,thelongestsubstringwithoutrepeatinglettersfor"abcabcbb"is"abc",which
u011133213
·
2014-04-29 00:00
IP
image
set
restore
substring
conversion
Matrix
rotate
longest
wi
addresses
zeroes
ZigZag
leetCode解题
报告5道题(五)
题目一:PathSumGivenabinarytreeandasum,determineifthetreehasaroot-to-leafpathsuchthataddingupallthevaluesalongthepathequalsthegivensum.Forexample:Giventhebelowbinarytreeand sum=22,5 /\ 48 //\ 11134 /\\ 72
u011133213
·
2014-04-22 20:00
LeetCode
array
distinct
tree
SUM
Path
merge
sorted
subsequence
Symmetric
leetCode解题
报告5道题(四)
题目一:LongestConsecutiveSequence Givenanunsortedarrayofintegers,findthelengthofthelongestconsecutiveelementssequence.Forexample,Given [100,4,200,1,3,2],Thelongestconsecutiveelementssequenceis [1,2,3,4].
u011133213
·
2014-04-09 11:00
LeetCode
SUM
unique
search
Path
binary
maximum
reverse
valid
words
palindrome
leetCode解题
报告5道题(三)
题目一:BinaryTreeZigzagLevelOrderTraversalGivenabinarytree,returnthe zigzaglevelorder traversalofitsnodes'values.(ie,fromlefttoright,thenrighttoleftforthenextlevelandalternatebetween).Forexample:Givenbin
u011133213
·
2014-04-04 23:00
LeetCode
数据结构
二叉树
胖虎
leetcode题解
leetCode解题
报告5道题(二)
leetcode上比较简单的几道题,不想分开写几篇博文来记录哈,所以写在一起了!!虽然几道题都比较简单,但感觉自己写得不好,希望博文如果被哪位大神看到,可以留言下写下你的做法!题目一:MaximumDepthofBinaryTree Givenabinarytree,finditsmaximumdepth.Themaximumdepthisthenumberofnodesalongthelonge
u011133213
·
2014-04-03 22:00
leetCode解题
报告之Palindrome Partitioning I,II(DFS,DP)
题目:PalindromePartitioning IGivenastring s,partition s suchthateverysubstringofthepartitionisapalindrome.Returnallpossiblepalindromepartitioningof s.Forexample,given s = "aab",Return[ ["aa","b"], ["a",
u011133213
·
2014-03-31 01:00
LeetCode
dp
partition
动态规划
DFS
palindrome
leetCode解题
报告之Binary Tree Level Order Traversal II,I(二叉树层次遍历)
题目:BinaryTreeLevelOrderTraversalII(由于BinaryTreeLevelOrderTraversalI这个题目只是在II的基础上少了一步最后的翻转resultlist而已,所以我就不贴出它的代码了)Givenabinarytree,returnthe bottom-uplevelorder traversalofitsnodes'values.(ie,fromlef
u011133213
·
2014-03-28 20:00
LeetCode
level
Queue
order
二叉树层次遍历
Traversa
leetCode解题
报告之Clone Graph
题目:Cloneanundirectedgraph.Eachnodeinthegraphcontainsa label andalistofits neighbors.OJ'sundirectedgraphserialization:Nodesarelabeleduniquely.Weuse # asaseparatorforeachnode,and , asaseparatorfornodela
u011133213
·
2014-03-27 16:00
LeetCode
数据结构
Graph
clone
AC代码
leetcode解题报告
leetCode解题
报告之Gas Station
题目:Thereare N gasstationsalongacircularroute,wheretheamountofgasatstation i is gas[i].Youhaveacarwithanunlimitedgastankanditcosts cost[i] ofgastotravelfromstation i toitsnextstation(i+1).Youbeginthejo
u011133213
·
2014-03-26 09:00
LeetCode
Algorithm
数据结构与算法
Station
gas
leetCode解题
报告之Candy(简单回溯)
题目:Thereare N childrenstandinginaline.Eachchildisassignedaratingvalue.Youaregivingcandiestothesechildrensubjectedtothefollowingrequirements:Eachchildmusthaveatleastonecandy.Childrenwithahigherratingge
u011133213
·
2014-03-26 08:00
leetCode解题
报告之构造二叉树(递归)
此博文主要讲述了构造二叉树的两种方法:1、通过先序和中序构造出二叉树(来自leetCodeOJ上的题目:ConstructBinaryTreefromPreorderandInorderTraversal )2、通过后序和中序构造出二叉树(来自leetCodeOJ上的题目:ConstructBinaryTreefromInorderandPostorderTraversal)这两题的解法类似,下
u011133213
·
2014-03-25 19:00
LeetCode
Algorithm
算法
二叉树
maximum
Subarray
leetCode解题
报告之O(n)线性时间求最大子序列和(Maximum Subarray)
题目:Findthecontiguoussubarraywithinanarray(containingatleastonenumber)whichhasthelargestsum.Forexample,giventhearray [−2,1,−3,4,−1,2,1,−5,4],thecontiguoussubarray [4,−1,2,1] hasthelargestsum= 6.clickto
u011133213
·
2014-03-25 12:00
LeetCode
分治法
maximum
DP问题
Subarray
求最大子序列和
leetCode解题
报告5道题(一)
比较简单的几道题,不做详细的解释,只为之后可以回头看看自己之前的代码!!虽然几道题都比较简单,但感觉自己写得不好,希望博文如果被哪位大神看到,可以留言下写下你的做法!题目一:ReverseLinkedListIIReversealinkedlistfromposition m to n.Doitin-placeandinone-pass.Forexample:Given 1->2->3->4->5
u011133213
·
2014-03-23 11:00
LeetCode
二叉树
merge
traversal
链表合并
leetCode解题
报告之SingleNumberI,II(知识点:位运算)
由于两题是姐妹题,所以放在同一个博文里了!题目1:Givenanarrayofintegers,everyelementappears twice exceptforone.Findthatsingleone.Note:Youralgorithmshouldhavealinearruntimecomplexity.Couldyouimplementitwithoutusingextramemory
u011133213
·
2014-03-23 00:00
LeetCode
位运算
Algorithm
number
number
single
single
II
leetCode解题
报告之Copy List with Random Pointer
题目:Alinkedlistisgivensuchthateachnodecontainsanadditionalrandompointerwhichcouldpointtoanynodeinthelistornull.Returnadeepcopyofthelist.分析:我们知道如果是简单的copyList的话,那么我们只需要从头到尾遍历下来,new出对应个数的Node,并把它们的连接关系设置
u011133213
·
2014-03-22 23:00
LeetCode
list
list
copy
copy
with
数据结构与算法
Random
解题报告
Rando
leetCode解题
报告之Reorder List
题目:Givenasinglylinkedlist L: L0→L1→…→Ln-1→Ln,reorderitto: L0→Ln→L1→Ln-1→L2→Ln-2→…Youmustdothisin-placewithoutalteringthenodes'values.Forexample,Given {1,2,3,4},reorderitto {1,4,2,3}.分析:看到这个题目,我们首先容易想到
u011133213
·
2014-03-18 13:00
LeetCode
链表
list
解题报告
reorder
leetCode解题
报告之Binary Tree Postorder Traversal
题目:BinaryTreePostorderTraversal Givenabinarytree,returnthe postorder traversalofitsnodes'values.Forexample:Givenbinarytree {1,#,2,3},1 \ 2 / 3 return [3,2,1].Note: Recursivesolutionistrivial,couldyoud
u011133213
·
2014-03-17 08:00
LeetCode
list
二叉树
sort
traversal
insertion
非递归遍历
leetCode解题
报告之Sort List
勉励自己:坚持,谁说做工程的人不能学好算法!为面试做准备,加油!!!!!题目:Sortalinkedlistin O(n log n)timeusingconstantspacecomplexity.分析:题目要求我们要用一个复杂度O(nlogn)的排序算法来排序一个链表,复杂度O(nlogn)的排序算法包括:快速排序,堆排序,希尔排序,二叉排序树排序,归并排序情况:考虑到题目的要求,我个人觉得用
u011133213
·
2014-03-16 22:00
LeetCode
list
递归
归并排序
sort
链表排序
leetCode解题
报告之Insertion Sort List
题目:Sortalinkedlistusinginsertionsort.分析:这个题目是想要让我们来做一个链表的插入排序问题.这样,我们只要从第一个元素一直往后,直到所有的节点都在前面的序列中找到自己所在的位置即可情况:1.当前值比head的值还小,这情况要插入到head节点之前2.当前值比head的值大,这情况要插入到相应的位置3.当前值大于所有该节点之前的值,那么当cmpNode(用来作比较
u011133213
·
2014-03-14 00:00
LeetCode
链表
list
插入排序
sort
insertion
上一页
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
其他