链接:https://leetcode cn.com/problems/binary tree level order traversal/ ...
分类:
其他好文 时间:
2020-04-05 22:26:38
阅读次数:
69
1、准备数据 import numpy as np import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.keras import models,layers dftra ...
分类:
其他好文 时间:
2020-04-05 18:16:13
阅读次数:
337
Given the root of a binary tree, find the maximum value V for which there exists different nodes A and B where V = |A.val - B.val| and A is an ancesto ...
分类:
其他好文 时间:
2020-04-05 12:01:52
阅读次数:
97
一、题目说明 题目236. Lowest Common Ancestor of a Binary Tree,在一个二叉树中找两个节点的最近公共祖先。难度是Medium! 二、我的解答 这个用二叉树的递归遍历,稍加改造即可: 性能如下: 三、优化措施 其他方法,暂时想不起来。 ...
分类:
其他好文 时间:
2020-04-05 09:24:53
阅读次数:
61
这里主要介绍二进制、十进制、十六进制的转换 一.基本概念: ①数码:用来表示进制数的元素 binary二进制数码:0,1 decimal十进制数码:0,1,2,3,4,5,6,7,8,9 hexadecimal十六进制数码:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F ②基数:数码 ...
分类:
其他好文 时间:
2020-04-04 20:19:49
阅读次数:
63
[TOC] 什么是二叉树? 在实现二分搜索树之前,我们先思考一下,为什么要有树这种数据结构呢?我们通过企业的组织机构、文件存储、数据库索引等这些常见的应用会发现,将数据使用树结构存储后,会出奇的高效,树结构本身是一种天然的组织结构。常见的树结构有:二分搜索树、平衡二叉树(常见的平衡二叉树有AVL和红 ...
分类:
其他好文 时间:
2020-04-04 09:57:45
阅读次数:
65
bin --(/usr/bin,/usr/local/bin)Binary缩写,这个目录存放经常使用的命令 sbin --(/urs/sbin,/usr/local/sbin)s系Super User,存放系统管理员使用的系统管理程序 boot --存放启动Linux时使用的一些核心文件,包括一些连 ...
分类:
系统相关 时间:
2020-04-03 23:59:46
阅读次数:
142
面试题37. 序列化二叉树 请实现两个函数,分别用来序列化和反序列化二叉树。 示例: 你可以将以下二叉树: 1 / \ 2 3 / \ 4 5 序列化为 "[1,2,3,null,null,4,5]" /** * Definition for a binary tree node. * public ...
分类:
其他好文 时间:
2020-04-03 22:09:27
阅读次数:
66
详解二叉查找树(BST) 本篇随笔简单讲解一下数据结构——二叉查找树($Binary\,\,Sort\,\,Tree,BST$),(后文的“二叉查找树”一词均用$BST$代替)。 BST的概念 首先,$BST$是一棵二叉树。 它的定义是,根节点左子树全部 严格小于 根节点,右子树 大于等于 根节点, ...
分类:
其他好文 时间:
2020-04-03 20:06:24
阅读次数:
61
2020-04-03 路径总和 题解: 思路1: 递归 /** * Definition for a binary tree node. * function TreeNode(val) { * this.val = val; * this.left = this.right = null; * } ...
分类:
其他好文 时间:
2020-04-03 13:53:34
阅读次数:
54