Problem LeetCode Given the root of a binary tree, return the sum of every tree node's tilt. The tilt of a tree node is the absolute difference between ...
分类:
编程语言 时间:
2021-01-25 11:29:21
阅读次数:
0
Problem LeetCode Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: I ...
分类:
编程语言 时间:
2021-01-21 10:55:51
阅读次数:
0
124. 二叉树中的最大路径和 路径 被定义为一条从树中任意节点出发,沿父节点-子节点连接,达到任意节点的序列。该路径 至少包含一个 节点,且不一定经过根节点。 路径和 是路径中各节点值的总和。 给你一个二叉树的根节点 root ,返回其 最大路径和 。 示例 1: 输入:root = [1,2,3 ...
分类:
其他好文 时间:
2021-01-19 12:04:37
阅读次数:
0
1.确认下面内容(管理员权限) yum install gcc yum install pcre pcre-devel yum install zlib zlib-devel yum install openssl openssl-devel 2.下载Nginx,选择稳定版(Stable) 目录:/ ...
分类:
其他好文 时间:
2021-01-18 11:28:16
阅读次数:
0
1. 二分查找 C++ STL标准库中提供有 lower_bound()、upper_bound()、equal_range() 以及 binary_search() 这 4 个查找函数,它们的底层实现采用的都是二分查找的方式。 1.1 lower_bound() lower_bound() 函数用 ...
分类:
其他好文 时间:
2021-01-18 11:23:23
阅读次数:
0
1 前言 我曾经写过《杂谈.netcore的Buffer相关新类型》的博客,简单介绍过BinaryPrimitives、Span<>,Memory<>,ArrayPool<>,Memorypool<>这些基础类型,在实际项目中,我们更需要的是更上层的高效缓冲区申请、buffer写入、buffer读取 ...
分类:
Web程序 时间:
2021-01-18 10:36:59
阅读次数:
0
参考:https://www.yangliuan.cn/?p=1090 1.安装所需工具 yum install --downloadonly --downloaddir=rpm gcc gcc-c++ glibc make autoconf openssl openssl-devel pcre-d ...
分类:
其他好文 时间:
2021-01-16 11:56:39
阅读次数:
0
树状数组 (Binary Index Tree, BIT) 用于解决这样一个问题:给定数组 a[n], 并且要求 w 次修改数组,现有 q 次区间查询,区间查询要求返回任意给定区间之和。 如果采用暴力方法,一次修改需要 \(O(1)\) 的时间复杂度,一次查询需要 \(O(n)\) 的时间复杂度,总 ...
分类:
编程语言 时间:
2021-01-16 11:53:30
阅读次数:
0
此博客链接: 可被5整除的二进制 题目链接:https://leetcode-cn.com/problems/binary-prefix-divisible-by-5/ 题目 给定由若干 0 和 1 组成的数组 A。我们定义 N_i:从 A[0] 到 A[i] 的第 i 个子数组被解释为一个二进制数 ...
分类:
其他好文 时间:
2021-01-15 11:55:58
阅读次数:
0
1. 在 Windows 上安装 GCC,需要到MinGW 的主页 www.mingw.org,进入 MinGW 下载页面,下载最新版本的 MinGW 安装程序,; 或者到:http://sourceforge.net/projects/mingw/files/,下载 Download mingw- ...