#111. 二叉树的最小深度 https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/ 关键在于知道f(root)=min(f(left),f(right))+1这个表达式 class Solution { public: int ...
分类:
其他好文 时间:
2021-03-16 12:04:09
阅读次数:
0
void flatten(TreeNode root) { // base case,即最小 if (root == null) return; flatten(root.left); flatten(root.right); /**** 后序遍历 ****/ // 1、保存原来的左右节点,避免变换 ...
分类:
其他好文 时间:
2021-03-16 11:50:33
阅读次数:
0
Binary Trees With Factors (M) 题目 Given an array of unique integers, arr, where each integer arr[i] is strictly greater than 1. We make a binary tree u ...
分类:
其他好文 时间:
2021-03-15 11:24:45
阅读次数:
0
Description: Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by lev ...
分类:
其他好文 时间:
2021-03-15 11:13:18
阅读次数:
0
<div class="el-tree-box"> <div class="demo-box"> <el-tree class="my-scrool-com" :data="treeList" :props="defaultProps" :expand-on-click-node="false" > ...
分类:
其他好文 时间:
2021-03-15 11:01:38
阅读次数:
0
Mysql存储引擎MyISAM与InnoDB - B+树数据的增删细节 Mysql存储引擎MyISAM与InnoDB - B+树数据的增删细节 前言Mysql索引文件的存储结构 1. InnoDB - B+Tree,叶子节点直接放置数据1.2 回表 2. MyISAM--B+Tree,叶子节点放置数 ...
分类:
数据库 时间:
2021-03-15 10:53:32
阅读次数:
0
C - UFO 题意 给一个 \(n\times m\) 的矩形,代表对应位置方块的数目,现在进行 \(k\) 次激光攻击,每次激光攻击会在高度 \(h\) 处从 \(N,S,W,E\) 四个方向中的一个向对面发射激光,若命中一个块,则改方块消失,每次激光最多消灭 \(r\) 个方块。 攻击结束后, ...
分类:
其他好文 时间:
2021-03-12 12:40:39
阅读次数:
0
macOS下将GitHub中单个子文件夹下载到本地 参考博客:https://www.cnblogs.com/Hi-blog/p/9008932.html 命令行中使用homebrew安装subversion: brew install subversion 将子文件夹url地址中的tree/mas ...
分类:
系统相关 时间:
2021-03-11 20:50:05
阅读次数:
0
The left-view of a binary tree is a list of nodes obtained by looking at the tree from left hand side and from top down. For example, given a tree sho ...
分类:
其他好文 时间:
2021-03-11 18:26:16
阅读次数:
0
想清楚它不是DP而是贪心就好做了 首先, 我们称子树刚好包含所有某一颜色的点为临界点, 那我们要优先选择深度越深的临界点越好 用另一种方式来说, 在dfs的过程中, 第一次发现有一个点恰好为临界点,那么就选择这个点为分界线新增一个答案, 很容易想清楚, 选择越深的肯定更优, 让其它点的有更多分块的机 ...
分类:
其他好文 时间:
2021-03-09 13:33:11
阅读次数:
0