B树的介绍 B-tree树即B树,B即Balanced,表示平衡。有人把B-tree翻译成B-树,容易让人产生误解。会认为B-树是一种树,而B树又是另一种树。实际上,B-tree就是指的B树。 B+树的介绍 B+树是B树的变体,也是一种多路搜索树 ...
分类:
其他好文 时间:
2020-02-01 12:45:09
阅读次数:
71
题意: 告诉你n头奶牛的高度,然后给你一个区间,你需要求出这个区间最高的奶牛与最矮的奶牛之间相差多少 链接:http://poj.org/problem?id=3264 思路: 线段树区间查询,用两个查询函数,一个查最大值,另一个查最小值,将他们相减即可。 代码: #include <iostrea ...
分类:
其他好文 时间:
2020-01-21 21:43:28
阅读次数:
65
参考:https://github.com/vandit15/Class-balanced-loss-pytorch 其中的class_balanced_loss.py: import numpy as np import torch import torch.nn.functional as F ...
分类:
其他好文 时间:
2020-01-15 19:13:33
阅读次数:
96
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d ...
分类:
其他好文 时间:
2020-01-09 13:08:36
阅读次数:
69
题目描述 输入一棵二叉树,判断该二叉树是否是平衡二叉树。 解析 “平衡二叉树(Balanced Binary Tree)具有以下性质:它是一棵空树或它的左右两个子树的高度差的绝对值不超过1,并且左右两个子树都是一棵平衡二叉树。 自己提交代码: 思路:根据求树深度的方法,求当前节点左右子树最大深度并判 ...
分类:
其他好文 时间:
2020-01-04 14:12:07
阅读次数:
70
"题目" 一道树状数组的裸题。 值得一提的是题目的翻译貌似有点问题。 如果L[i]和R[i]的数目相差2倍以上的话,第i头奶牛就是不平衡的。(L[i]和R[i]分别代表第i头奶牛左右两边比她高的数量)。如果L[i]和R[i]中较大者比较小者的数量严格多两倍的话,这头奶牛也是不平衡的 题目中这段话的意 ...
分类:
其他好文 时间:
2019-12-29 11:04:30
阅读次数:
66
思路: dp,使用了bitset优化。 实现: ...
分类:
其他好文 时间:
2019-12-17 18:12:04
阅读次数:
95
链接: https://vjudge.net/problem/HDU 3709 题意: A balanced number is a non negative integer that can be balanced if a pivot is placed at some digit. More ...
分类:
其他好文 时间:
2019-12-07 01:14:03
阅读次数:
81
链接: https://vjudge.net/problem/SPOJ BALNUM 题意: Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a bal ...
分类:
其他好文 时间:
2019-12-07 00:59:49
阅读次数:
78
There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties: (1) Every node is either ...
分类:
其他好文 时间:
2019-11-23 21:36:27
阅读次数:
58