04 2017 档案
摘要:105. Construct Binary Tree from Preorder and Inorder Traversal 题目链接:https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-trav
阅读全文
摘要:5. Longest Palindromic Substring 题目链接:https://leetcode.com/problems/longest-palindromic-substring/#/description 题目大意:给定一个字符串s,返回该字符串的最长回文子串。s的最大长度不超过1
阅读全文
摘要:78. Subsets 题目链接:https://leetcode.com/problems/subsets/#/description 题目大意:给定一个整数集合,所有的整数都不相等,要求返回所有可能的子集。 题目思路:排列组合问题,集合中的任意元素,都能产生两类子集,一类包含该元素,一类不包含该
阅读全文
摘要:226. Invert Binary Tree 题目链接:https://leetcode.com/problems/invert-binary-tree/#/description 题目大意:反转一棵二叉树 思路:递归反转左子树和右子树,然后再交换左子树和右子树的根节点即可。 算法复杂度分析:时间
阅读全文

浙公网安备 33010602011771号