![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
麻雀2025
这个作者很懒,什么都没留下…
展开
-
Merge Two Binary Trees LeetCode617 java实现
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge them into a new binary tree....原创 2018-11-28 09:40:57 · 104 阅读 · 0 评论 -
Search in a Binary Search Tree--LeetCode700 java
Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node’s value equals the given value. Return the subtree rooted with that node. If such node...原创 2018-11-28 09:55:17 · 116 阅读 · 0 评论 -
排列组合递归解法总结--combination字符串排列
全排列的递归实现 https://mintlucas.github.io/2019/02/27/递归思想总结-排列组合为例/ 原问题分解:1234全排列,234全排列,34全排列,4全排列,显然是递归思想,而解决方法是交换(从第一个数字起,将它与其后面的每个数字进行交换,swap(array[idx], array[i]);)用for:1:n来控制这个分解过程。 递归程序需要至少一个变量来控制递归...原创 2019-02-27 16:50:01 · 470 阅读 · 0 评论 -
剑指Offer(四):重建二叉树
题目:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。 思路:递归思想,每次将左右两棵子树当成新的子树进行处理。(在ide里模拟建议全部copy到自己的Ide或从后往前看) 前序的第一个索引就是根节点,在中序...原创 2019-03-17 11:50:32 · 119 阅读 · 0 评论