地址 https://leetcode-cn.com/contest/weekly-contest-190/problems/pseudo-palindromic-paths-in-a-binary-tree/ 题目描述给你一棵二叉树,每个节点的值为 1 到 9 。我们称二叉树中的一条路径是 「伪回 ...
分类:
其他好文 时间:
2020-05-24 13:51:05
阅读次数:
73
# 树的单个结点 class Node: def __init__(self,elem): # 结点数据 self.elem = elem # 左子树和右子树 self.lchild = None self.rchild = None # 二叉树的实现 class my_tree: # 初始化空树 ...
分类:
其他好文 时间:
2020-05-24 13:46:26
阅读次数:
51
前言 100道MySQL数据库经典面试题解析,已经上传github啦 https://github.com/whx123/JavaHome/tree/master/Java%E9%9D%A2%E8%AF%95%E9%A2%98%E9%9B%86%E7%BB%93%E5%8F%B7 公众号:捡田螺的小 ...
分类:
数据库 时间:
2020-05-24 13:44:05
阅读次数:
99
$$\text{Link(Renko, Merry);}$$
$$\text{Cut(Renko, Merry);}$$
$$\color{red}{\text{Runtime Error!}}$$ ...
分类:
其他好文 时间:
2020-05-24 12:08:05
阅读次数:
51
import java.util.HashMap;import java.util.LinkedList;import java.util.Queue;/** * 二叉树最大宽度 */public class TreeMaxWidth { /** * 不使用HashMap实现 * * @param ...
分类:
其他好文 时间:
2020-05-24 11:52:46
阅读次数:
54
索引的分类 B Tree索引 B Tree 索引适合全键值、键值范围、键前缀查找(只适用于根据最左前缀的查找)。 全值匹配 匹配最左前缀 匹配列前缀 匹配范围值 精准匹配某一列并范围匹配另外一列 只访问索引的查询 B Tree索引的限制 若不是按照索引的最左列开始查找,则无法使用索引。 不能跳过索引 ...
分类:
数据库 时间:
2020-05-24 11:42:35
阅读次数:
78
题意: 给出一棵点权树,一个树的大小定义为所有点的权值和。问将一棵树分为 $k$ 棵子树,如何分割才能使所有树的大小的最大值最小? "传送门" 分析: 最大值最小化问题,考虑用二分求解,枚举答案。 问题转化为如何分割树来判断当前答案是否满足要求。如果一个子树 $v$ 的权重大于 $mid$,则先选择 ...
分类:
其他好文 时间:
2020-05-24 11:32:52
阅读次数:
51
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 ...
分类:
其他好文 时间:
2020-05-24 11:27:13
阅读次数:
52
Log-StructuredMerge-Tree,简称LSM。以Mysql、postgresql为代表的传统RDBMS都是基于b-tree的page-orented存储引擎。现代计算机的最大处理瓶颈在磁盘的读写上,数据存储无法绕开磁盘的读写,纯内存型数据库除外,但由于内存存储的不稳定性,我们一般只将内存型的存储作为缓存系统。为提升数据库系统的写性能,我们发现磁盘的顺序写性能远远大于随机写性能,甚至
分类:
数据库 时间:
2020-05-24 10:03:35
阅读次数:
89
Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all ...
分类:
其他好文 时间:
2020-05-24 00:24:06
阅读次数:
58