码迷,mamicode.com
首页 >  
搜索关键字:symmetric tree    ( 18259个结果
Codeforces 1363E - Tree Shuffling (思维/dfs/记忆化)
Codeforces Round #646 (Div. 2) - E. Tree Shuffling ...
分类:其他好文   时间:2020-06-01 09:17:28    阅读次数:98
集合框架Map
Map接口:专门处理键值映射数据的存储,可以根据键实现对值的操作。 Map接口有HashMap/TreeMap两个实现类。我们常用的是HashMap这个类。 Map有以下几个常用方法: 使用: Map map= new HashMap(); // 增加元素 map.put("CN","中国"); m ...
分类:其他好文   时间:2020-05-31 19:37:30    阅读次数:52
Treap
Treap=Tree+Heap,即在普通二叉查找树的基础上每个节点有了一个新值域:强化值(因为它将普通二叉查找树强化为treap就自己起了这个名字,是用来满足堆性质的,即后文说满足堆性质都指强化值满足堆性质)。要求这个树节点的键值(即要代表的数)满足BST的性质、强化值满足小跟堆的性质(你非得大根堆 ...
分类:其他好文   时间:2020-05-31 18:15:35    阅读次数:59
101. Symmetric Tree. 递归判断镜像二叉树
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet ...
分类:其他好文   时间:2020-05-31 17:37:36    阅读次数:56
Algorithms - Data Structure - Binary Search Tree - 数据结构之二叉搜索树
概念 Binary Search Tree二叉搜索树的性质: 设x是binarysearchtree中的一个节点。 如果y是x左子树中的一个节点, 那么y.key<=x.key 如果y是x右子树中的一个节点,那么y.key>=x.key Python Programming # taking the ...
分类:其他好文   时间:2020-05-31 14:28:09    阅读次数:63
Leetcode 101. 对称二叉树 遍历
地址 https://leetcode-cn.com/problems/symmetric-tree/ 给定一个二叉树,检查它是否是镜像对称的。 例如,二叉树 [1,2,2,3,4,4,3] 是对称的。 1 / \ 2 2 / \ / \ 3 4 4 3 但是下面这个 [1,2,2,null,3,n ...
分类:其他好文   时间:2020-05-31 12:55:56    阅读次数:49
二叉搜索树_BST
二叉搜索树 定义 二叉查找树(英语:Binary Search Tree),也称为二叉搜索树、有序二叉树(ordered binary tree)或排序二叉树(sorted binary tree),是指一棵空树或者具有下列性质的二叉树: 若任意节点的左子树不空,则左子树上所有节点的值均小于它的根节 ...
分类:其他好文   时间:2020-05-31 00:56:13    阅读次数:52
11. Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l ...
分类:其他好文   时间:2020-05-31 00:45:36    阅读次数:52
TreeSet实现自定义排序
public class User implements Comparable{ private String name; private int age; public User() { } public User(String name, int age) { this.name = name; ...
分类:编程语言   时间:2020-05-30 22:19:46    阅读次数:85
二叉树展开成链表
先来一个前序遍历把所有结点存在一个列表中,然后遍历链表,把所有结点用右指针串起来 1 /** 2 * Definition for a binary tree node. 3 * public class TreeNode { 4 * int val; 5 * TreeNode left; 6 * ...
分类:其他好文   时间:2020-05-30 22:05:09    阅读次数:83
18259条   上一页 1 ... 71 72 73 74 75 ... 1826 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!