上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 50 下一页
摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1and s2. Example 1: Example 2: 给定字符串s1, s2, s3,求s3是否可以由s1和s2交错形成。 解法:DP动态规划, 递推公式为 阅读全文
posted @ 2018-10-16 05:22 轻风舞动 阅读(474) 评论(0) 推荐(0) 编辑
摘要: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文
posted @ 2018-10-16 05:09 轻风舞动 阅读(361) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文
posted @ 2018-10-16 04:45 轻风舞动 阅读(391) 评论(0) 推荐(0) 编辑
摘要: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Example 2: Follow up: A 阅读全文
posted @ 2018-10-16 04:36 轻风舞动 阅读(475) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. For example:Given 阅读全文
posted @ 2018-10-16 04:27 轻风舞动 阅读(1254) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo 阅读全文
posted @ 2018-10-16 04:09 轻风舞动 阅读(663) 评论(0) 推荐(1) 编辑
摘要: Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For 阅读全文
posted @ 2018-10-16 02:17 轻风舞动 阅读(431) 评论(0) 推荐(0) 编辑
摘要: In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this n 阅读全文
posted @ 2018-10-16 01:37 轻风舞动 阅读(544) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 阅读全文
posted @ 2018-10-13 05:31 轻风舞动 阅读(768) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
posted @ 2018-10-13 05:13 轻风舞动 阅读(501) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 50 下一页