标签: recursion
-
leetcode430-Flatten-a-Multilevel-Doubly-Linked-List
从深度优先遍历的角度来看,每次遇到一个包含子节点中间双链表节点,就递归的调用展开方法将其展开,并将展开的结果插…
-
leetcode363-Max-Sum-of-Rectangle-No-Larger-Than-K
现有一个由整数构成的矩阵,问从中找到一个子矩阵,要求该子矩阵中各个元素的和为不超过k的最大值,问子矩阵中元素的…
-
leetcode429-Nary-Tree-Level-Order-Traversal
这个和一般的水平遍历有所区别,因为它会记录每一行的水平遍历结果分别存在结果数组相应行。因此首先可以用水平遍历的…
-
leetcode394. Decode String
将一个字符串解码,要求按照次数展开原字符串中的中括号。如3[a]2[bc]对应的字符串就是aaabcbc,即a…
-
leetcode386. Lexicographical Numbers
将1~n这n个数字按照字母序排序,并返回排序后的结果。即如果n=13,则1~13的字母序为1,10,11,12…
-
leetcode390.Elimination Game
假设有1-n一共n个数字,从左往右开始每隔一位删除一个数字,到达最右侧后,再从右往左每隔一位删除一个数字,如此…
-
[LeetCode] 545. Boundary of Binary Tree
Given a binary tree, return the values of its boundary …
-
[LeetCode] 617. Merge Two Binary Trees
Given two binary trees and imagine that when you put on…
-
[LeetCode] 385. Mini Parser
Given a nested list of integers represented as a string…