高级树、AVL 树和红黑树 二叉树遍历 Pre order/In order/Post orde 1. 前序(Pre order):根 左 右 2. 中序(In order):左 根 右 3. 后序(Post order):左 右 根 示例代码 二叉搜索树 Binary Search Tree 二叉 ...
分类:
其他好文 时间:
2020-03-29 01:24:53
阅读次数:
83
给定一个二叉树,原地将它展开为链表。 例如,给定二叉树 1 / \ 2 5 / \ \3 4 6将其展开为: 1 \ 2 \ 3 \ 4 \ 5 \ 6 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/flatten-binary-tree-to ...
分类:
其他好文 时间:
2020-03-28 21:58:14
阅读次数:
68
LCA 模板 例题 [CF1304E]1 Trees and Queries https://codeforces.com/contest/1304/problem/E 题意 给一棵树,每次查询时在x和y之间加一条边,然后问在a和b之间是否存在一条可以重复走的路径且这条路径的长度为k 思路 如果不走 ...
分类:
其他好文 时间:
2020-03-28 21:34:56
阅读次数:
70
[toc] Description A number is called quasibinary if its decimal representation contains only digits 0 or 1. For example, numbers 0, 1, 101, 110011 — a ...
分类:
其他好文 时间:
2020-03-28 20:25:08
阅读次数:
93
指令: curl 172.17.1.15:9200/_bulk?pretty --data-binary @E:\Bin\Debug\testdata\437714060.json json文件的内容定义 {"index":{"_index":"meterdata","_type":"autoDat ...
分类:
其他好文 时间:
2020-03-28 10:44:27
阅读次数:
253
注:LeetCode--树专题。 题目链接(1305):https://leetcode-cn.com/problems/all-elements-in-two-binary-search-trees/ 题目描述: 给你 root1 和 root2 这两棵二叉搜索树。 请你返回一个列表,其中包含 两 ...
分类:
其他好文 时间:
2020-03-27 21:47:16
阅读次数:
80
Trees are an important component of the natural landscape because of their prevention of erosion and the provision of a specific ather-sheltered ecosy ...
分类:
其他好文 时间:
2020-03-26 23:12:43
阅读次数:
109
题目描述 在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 思考 1. 二分查找 | a1 | a2 | a3 | a4 | a5 | a6 | | | | ...
分类:
编程语言 时间:
2020-03-26 13:43:30
阅读次数:
82
题意:在BST中寻找两个节点,使它们的和为一个给定值。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(in ...
分类:
其他好文 时间:
2020-03-26 01:22:25
阅读次数:
70
[leetcode]1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree 链接 "leetcode" 描述 Given two binary trees original and cloned and giv ...
分类:
其他好文 时间:
2020-03-25 19:39:53
阅读次数:
70