上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 105. Construct Binary Tree from Preorder and Inorder Traversal Given preorder and inorder traversal of a tree, c 阅读全文
posted @ 2019-01-05 19:47 wikiwen 阅读(465) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 124. Binary Tree Maximum Path Sum Given a non-empty binary tree, find the maximum path sum. For this problem, a 阅读全文
posted @ 2019-01-05 19:45 wikiwen 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 572. Subtree of Another Tree Given two non-empty binary trees s and t, check whether tree t has exactly the same 阅读全文
posted @ 2019-01-05 19:44 wikiwen 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 112. Path Sum Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up a 阅读全文
posted @ 2019-01-05 19:44 wikiwen 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 27 二叉树的镜像 题目描述 操作给定的二叉树,将其变换为源二叉树的镜像。 输入描述: 二叉树的镜像定义:源二叉树 8 / \ 6 10 / \ / \ 5 7 9 11 镜像二叉树 8 / \ 10 6 / \ / \ 1 阅读全文
posted @ 2019-01-05 19:43 wikiwen 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 101. Symmetric Tree /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * 阅读全文
posted @ 2019-01-05 19:42 wikiwen 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 110. Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-ba 阅读全文
posted @ 2019-01-05 19:30 wikiwen 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 104. Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number o 阅读全文
posted @ 2019-01-05 19:29 wikiwen 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 68 树中两个节点的最低公共祖先 题目: 求树中两个结点的最低公共祖先 思路: 考虑一下几种情况: 1、该树为二叉搜索树 二叉搜索树是排序树,位于左子树点的结点都比父结点小,而位于右子树的结点都比父结点大,只需要从树的根结点 阅读全文
posted @ 2019-01-05 19:28 wikiwen 阅读(797) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode & 剑指offer 刷题笔记】目录(持续更新中...) 二叉查找树的查找、插入、删除 1 查找结点 最佳情况是 O(log­2n),而最坏情况是 O(n) BST 的查找是从根结点开始,若二叉树非空,将给定值与根结点的关键字比较, 若相等,则查找成功; 若不等,则比较查找结点值与 阅读全文
posted @ 2019-01-05 19:27 wikiwen 阅读(227) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页