随笔分类 - [LeetCode]
摘要:The problem:Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].My...
阅读全文
摘要:---恢复内容开始---The problem:Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that...
阅读全文
摘要:The problem:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are ...
阅读全文
摘要:The problem:Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next ...
阅读全文
摘要:The problem:Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binar...
阅读全文
摘要:The problem:Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retu...
阅读全文
摘要:The problem:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retur...
阅读全文
摘要:The problem:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retur...
阅读全文
摘要:The problem:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return...
阅读全文
摘要:The problem:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ...
阅读全文
摘要:The problem 1:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to t...
阅读全文
摘要:The problem:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree,...
阅读全文
摘要:The problem:Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2...
阅读全文
摘要:Problem 1 [Balanced Binary Tree]Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as ...
阅读全文
摘要:The problem:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",r...
阅读全文
摘要:The problem:Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.My analysis:The problem is easy at some extent,...
阅读全文
摘要:The problem:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(...
阅读全文
摘要:The problem:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node con...
阅读全文
摘要:The problem:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.My...
阅读全文
摘要:The problem:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.My ...
阅读全文

浙公网安备 33010602011771号