文章
120. Triangle
Givenatriangle,findtheminimumpathsumfromtoptobottom.Eachstepyoumaymovetoadjacentnumbersontherowbelow.Forexample,giventhef
129. Sum Root to Leaf Numbers
Givenabinarytreecontainingdigitsfrom09only,eachroottoleafpathcouldrepresentanumber.Anexampleistheroottoleafpath1>2>
130. Surrounded Regions
Givena2Dboardcontaining&39;X&39;and&39;O&39;(theletterO),captureallregionssurroundedby&39;X&39;.Aregioniscapturedbyflipping
138. Copy List with Random Pointer
Alinkedlistisgivensuchthateachnodecontainsanadditionalrandompointerwhichcouldpointtoanynodeinthelistornull.Returnadeepcop
102. Binary Tree Level Order Traversal
Givenabinarytree,returnthelevelordertraversalofitsnodes&39;values.(ie,fromlefttoright,levelbylevel).Forexample:<pre<codeG
【Leetcode】95~96 不同的二叉搜索树
Leetcode95不同的二叉搜索树II输入:3输出:<pre<code1,null,3,2,3,2,null,1,3,1,null,null,2,2,1,3,1,null,2,null,3</cod
143. Reorder List
GivenasinglylinkedlistL:L0→L1→…→Ln1→Ln,reorderitto:L0→Ln→L1→Ln1→L2→Ln2→…Youmaynotmodifythevaluesinthelist&39;snodes,onlynode
148. Sort List
SortalinkedlistinO(nlogn)timeusingconstantspacecomplexity.Example1:<pre<codeInput:4>2>1>3Output:1>2>3>4
用Backtracking思想解决subset/permutation/combination/partition问题
<pre<code这两天专门训练了backtracking类型的问题,包括N皇后、全排列全组合等等,我到现在也无法完全清晰描述recursive里的运行过程,但是多做了几道这种类型的题目之后发现还是很有套路的,即使思路不是很清晰也可以“凑”出代码。</code</prerecursiv
144. Binary Tree Preorder Traversal
Givenabinarytree,returnthepreordertraversalofitsnodes&39;values.Example:<pre<codeInput:1,null,2,31\2/3
已加载文章中没有匹配内容,试试其他关键词或清空搜索。