树

B树(也叫B-树)、B+树、B*树 0. 简介 在此声明,B-Tree最正确的翻译应该为B树,而不是B-树,也即并没有B-树的说法,二叉树叫Binary Tree,二叉搜索树叫Binary Search Tree(BST)B树叫Balance Tree,简写为B-Tree (注意是这两个单词连起来的意思,不是减号),B+树是B+ Tree。 1. BST(Binary Search Tree,即二叉搜索树,并不是B树) ... 阅读详情

树

定义:
有限节点组成一个具有层次关系的集合
分类:
(重点)二叉树 — 》》 完全二叉树
1.除最外层 外,其余各层均满了(1对2)
2.最外层要从左向右连续紧密排序
树的表示:
链式存储:
数据放到节点中,节点还存放子节点的地址(引用)

二叉树

1.创建完全二叉树(按照完全二叉树的规则挂树)
1.若树为空,挂到根节点
2.根节点入队
3.出队依次判断是否有左右孩子,没有则挂树
4.依次入队左右孩子,重复步骤3

class Node(object):
  def __init__(self,item):
      self.item = item
      self.lchild = None
      self.rchild = None

class Tree(object):
  def __init__(self):
      self.root= None
  def add(self,item):
      node = Node(item)
      # 若树为空,挂到根节点
      if self.root == None:
          self.root = node
          return
      # 根节点入队
      que = []
      que.append(self.root)
      # 出队一次判断是否有左右孩子,没有则挂树
      while len(que) >0:
          # 出队
          cur = que.pop(0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  if cur.lchild is None:
              cur.lchild = node
              return
          elif  cur.rchild is None:
              cur.rchild = node
              return
      # 依次入队左右孩子,重复步骤3
          else:
              que.append(cur.lchild)
              que.append(cur.rchild)
if __name__ == '__main__':
  tr = Tree()
  tr.add(2)
  tr.add(1)
  tr.add(3)

2 广度优先遍历
1 根节点入队
2 出队打印,依次入队左右孩子
3 重复步骤2 直到队列空

 def breath_travel(self):
       if self.root is None:
           return
       # 根节点入队
       que = []
       que.append(self.root)
       # 出队打印,依次入队左右孩子
       while len(que) >0:
           cur = que.pop(0)
           print(cur.item,end="--")
           if cur.lchild is not None:
               que.append(cur.lchild)
           if cur.rchild is not None:
               que.append(cur.rchild)
       # 重复步骤2
       # print()
       # 直到队列空

3 深度优先遍历
先序:根–》左子树–》右子树
中序:左子树–》根–》右子树
后序:左子树–》右子树–》根
递归实现

	
 def preorder(self, root):
        if root is None:
            return

       print(root.item,end="--")
       self.preorder(root.lchild)
       self.preorder(root.rchild)

   def inorder(self, root):
       if root is None:
           return

       self.inorder(root.lchild)
       print(root.item, end="--")
       self.inorder(root.rchild)

   def postorder(self, root):
       if root is None:
           return

       self.postorder(root.lchild)
       self.postorder(root.rchild)
       print(root.item, end="--")

查找节点

    def search(self, root, item):
        if root is None:
            return None

        if root.item == item:
            return root

        lres = self.search(root.lchild, item)
        if lres is not None:
            return lres
        rres = self.search(root.rchild, item)
        if rres is not None:
            return rres

        return None

if __name__ == '__main__':
    tr = Tree()
    tr.add(0)
    tr.add(1)
    tr.add(2)
    tr.add(3)
    tr.add(4)
    tr.add(5)
    tr.add(6)
    tr.add(7)
    tr.add(8)
    tr.add(9)
    nodeA = tr.search(tr.root, 7)
    nodeB = tr.search(tr.root, 3)

查找公共祖先

1.判断两个节点是否同时属于节点x 的左孩子 === 》 返回nodex的左孩子
2.判断两个节点是否同时属于节点x 的右孩子 === 》 返回nodex的右孩子
3.返回nodex

    def pub_dad(self,root,nodeA,nodeB):
        if root is None:
            return None
        if root == nodeA or root == nodeB:
            return root
        
        ldad = self.pub_dad(root.lchild, nodeA, nodeB)
        rdad = self.pub_dad(root.rchild, nodeA, nodeB)

        if ldad is None:
            return rdad
        elif rdad is None:
            return ldad
        else:
            return root



if __name__ == '__main__':
    tr = Tree()
    tr.add(0)
    tr.add(1)
    tr.add(2)
    tr.add(3)
    tr.add(4)
    tr.add(5)
    tr.add(6)
    tr.add(7)
    tr.add(8)
    tr.add(9)
    nodeA = tr.search(tr.root, 7)
    nodeB = tr.search(tr.root, 3)
    node_dad = tr.pub_dad(tr.root, nodeA, nodeB)

    print(node_dad.item)
算法——B树,B-树,B+树,B*树全面解析笔记 算法——B树,B-树,B+树,B*树全面解析笔记 https://zhuanlan.zhihu.com/p/54102723 https://www.cnblogs.com/lianzhilei/p/11250589.html B树 = B-树 B-树,即为B树。因为B树的原英文名称为B-tree,而国内很多人喜欢把B-tree译作B-树,其实,这是个非常不好的直译,很容易让人产生误解。如人们可能会以为B-树是一种树,而B树又是一种树。而事实上是,B-tree就是指的B树,目前理解B的意思为平衡 B树的出现 阅读详情

相关推荐

医学图像处理实战:3D Slicer从安装到病灶分析全流程指南

本文提供了一份详尽的3D Slicer实战指南,涵盖从软件安装、DICOM数据导入到图像增强、病灶分割及三维可视化的全流程。重点演示了如何利用阈值分割、区域生长等核心图像处理技术进行病灶分析,并生成定量报告,是医学影像分析初学者的实用入门教程。

weixin_29278805的博客 600

B树和B+树

一、BST树到AVL树到B树的简介 1.1 BST树 --- 二叉排序树 特点: 1. 根节点的值大于其左子树中任意一个节点的值 2. 根结点的值小于其右节点中任意一节点的值 3. 这一规则适用于二叉查找树中的每一个节点。 好处: 查询的时间复杂度比链表快,链表的查询时间复杂度是O(n),二叉排序树平均是O(logn)。二叉排序树越平衡,越能模拟二分法,所以越能想二分法的查询的时间复杂度O(logn)。 二叉排序树如下图: 不足: 但是BST树有一个不足的地方,就是如果插.

ZJE 4万+

AICodeing:AI驱动的全栈开发革命

作为阿里/字节跳动的资深Java工程师,我们正站在研发效能革命的临界点上。本文将深入探讨如何利用AI技术重构全栈开发流程,实现从需求到上线的量子级提速。

weixin_43290370的博客 1134

B树&B+树详解

B树(B-tree)是一种自平衡的树状数据结构,广泛应用于需要高效地插入、删除和查找操作的场景。B树的名称中的“B”代表“平衡(balanced)”,这是因为B树在进行插入和删除操作时,能够保持树的平衡性,即各个分支的深度相对平均。今天就让我们来深入学习一下。

2301_80035594的博客 2591

Unity3D Lua与C#的相互调用与性能剖析详解

在游戏开发中,经常会遇到Lua与C#之间的相互调用的情况。本文将详细介绍Unity3D中Lua与C#的相互调用的方式,并对其性能进行剖析。对惹,这里有一个游戏开发交流小组,希望大家可以点击进来一起交流一下开发经验呀!一、Lua与C#的相互调用方式Lua调用C#在Unity3D中,可以通过Lua调用C#的方式来实现Lua与C#的相互调用。具体步骤如下:(1)首先需要在Unity3D项目中导入Lua的相关库,例如tolua或者xlua。

weixin_49669470的博客 1213

别再翻手册了!用Materials Studio的Forcite模块,5步搞定复杂溶剂的溶解度参数计算

本文详细介绍了如何使用Materials Studio的Forcite模块,通过5个步骤快速计算复杂溶剂的溶解度参数。从分子建模、结构优化到分子动力学采样,再到最终的内聚能密度计算,该方法大幅提升了石油化工和高分子材料研发中的效率,避免了传统手册查阅和实验的繁琐过程。

weixin_28707739的博客 280

从B树、B+树、B*树谈到R 树

从B 树、B+ 树、B* 树谈到R 树   作者:July、weedge、Frankie。编程艺术室出品。 说明:本文从B树开始谈起,然后论述B+树、B*树,最后谈到R 树。其中B树、B+树及B*树部分由weedge完成,R 树部分由Frankie完成,全文最终由July统稿修订完成。 出处:http://blog.youkuaiyun.com/v_JULY_v 。   第一节、B树、B+树、B*...

结构之法 算法之道 66万+

最大似然估计、梯度下降、EM算法、坐标上升

主要讲解的是机器学习中参数学习算法之间的区别,以及应用的场景。 最大似然估计: 其中目标函数是对数似然函数。为了求目标函数取最大值时的theta。有两个关机键步骤,第一个是对目标函数进行求导,第二个是另导数等于0,求解后直接得到最优theta。两个步骤缺一不可。 梯度下降: 对目标函数进行求导,利用导函数提供的梯度信息,使参数往梯度下降最快的方向移动一小步,来更新参数。为什

tzl2093的博客 5141

B树、B-树、B+树、B*树 详细总结

B树 即二叉搜索树: 1.所有非叶子结点至多拥有两个儿子(Left和Right); 2.所有结点存储一个关键字; 3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树; B树的搜索,从根结点开始,如果查询的关键字与结点的关键字相等,那么就命中;否则,如果查询关键字比结点关键字小,就进入左儿子;如果比结点关...

杰哥一号号的博客 5427

02-Cesium-实现天地图标记

首先天地图申请token,然后Cesium-实现天地图标记详细说明

m0_62785037的博客 1171

杰理的蓝牙芯片的key是什么?以及该如何添加key?杰理key文件原理

很多的工程师,在开发杰理蓝牙芯片的第一步就会有一个很深的疑惑,关于key的 1、什么是key文件? 2、Key文件是如何产生的? 3、为什么需要他key文件? 4、如何添加key文件? 5、以及实际开发中的一些报错该如何处理?

qyvhome的博客 4095

B树,B-树和B+树、B*树的区别

之前一些概念混淆,现在更正一下。 B树 B-tree树即B树,B即Balanced,平衡的意思。因为B树的原英文名称为B-tree,而国内很多人喜欢把B-tree译作B-树,其实,这种直译不好,容易产生误解。如人们可能会以为B-树是一种树,而B树又是一种树。事实上,B-tree就是指B树。特此说明。 先介绍一下二叉搜索树: 1.所有非叶子结点至多拥有两...

qq_22613757的博客 1万+

matlab电子科技大学数学实验期末模拟35道(1)

【代码】matlab电子科技大学数学实验期末模拟35道。

c_wrj_的博客 2043

B树、B-树、B+树、B*树简介

B树 (二叉搜索树): 1.所有非叶子结点至多拥有两个儿子(Left和Right); 2.所有结点存储一个关键字; 3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树; 如: B树的搜索,从根结点开始,如果查询的关键字与结点的关键字相等,那么就命中;否则,如果查询关键字比结点关键字小,就进入左儿子;如果比结...

二十同学 7万+

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【转】从B 树、B+ 树、B* 树谈到R 树

从B 树、B+ 树、B* 树谈到R 树   作者:July、weedge、Frankie。编程艺术室出品。 说明:本文从B树开始谈起,然后论述B+树、B*树,最后谈到R 树。其中B树、B+树及B*树部分由weedge完成,R 树部分由Frankie完成,全文最终由July统稿修订完成。 出处:http://blog.youkuaiyun.com/v_JULY_v 。   第一节、B树、...

柏拉图工作室-AI学科 1万+

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

B树、B+树、AVL树、红黑树

binary search tree,中文翻译为二叉搜索树、二叉查找树或者二叉排序树。简称为BST B树        即二叉搜索树:        1.所有非叶子结点至多拥有两个儿子(Left和Right);        2.所有结点存储一个关键字;        3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树;

chlele0105的专栏 2万+

B树、B-树、B+树、B*树都是什么

B树、B-树、B+树、B*树都是什么         今天看数据库,书中提到:由于索引是采用 B 树结构存储的,所以对应的索引项并不会被删除,经过一段时间的增删改操作后,数据库中就会出现大量的存储碎片,这和磁盘碎片、内存碎片产生原理是类似的,这些存储碎片不仅占用了存储空间,而且降低了数据库运行的速度。如果发现索引中存在过多的存储碎片的话就要进行“碎片整理”了,最方便的“碎片整理”

史迪阳的博客 9737

图解:什么是B-树、B+树、B*树

文章目录 1.二叉搜索树 在说B树之前,我们需要先了解一下二叉搜索树 二叉搜索树,顾名思义,是用来搜索的有序树 它具有以下特点: 1.所有非叶子结点至多拥有两个儿子(Left和Right); 2.所有结点存储一个关键字; 3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树。 下边这个就是一棵二叉搜索树 1.1 二叉搜索树的查找 二叉搜索树的搜索,从根结点开始,如果查询的关键字与结点的关键字相等,那么就命中 否则,如果查询关键字比结点关键字小,就进入左儿子 如果比结点关键字大,就进

你好戴先生的博客 3116

B树、B+树、B*树

每个结点最多有m棵子树(子结点)根节点最少有一个子树,除根节点外,其他结点至少有[m/2]个子树所有叶节点都在同一层,按从小到大的顺序存放全部关键码,各个叶节点顺序连接有n个子树的结点有n个关键码所有非叶节点可以看成是叶节点的索引,节点中关键码Ki与指向子树的指针Pi构成对子树(即下一层索引块)的索引项(Ki,Pi),Ki是子树中最大的关键码B+ 树是 B 树的变体,也是一种多路搜索树。B*树是 B+ 树的变体,在 B+ 树的非根和非叶子节点再增加指向兄弟的指针B*树定义了非叶子节点。

2302_76977379的博客 1858

什么是B-树、B树、B+树、B*树?

文件系统的灵魂数据结构 B树什么是B-树、B树、B+树、B*树? 正如标题所言,本文介绍经常使我们混淆的B-树、B树、B+树和B*树。 首先,B-tree树即B树。B即Balanced平衡,因为B树的原英文名称为B-tree,而国内很多人喜欢把B-tree译作B-树,这是个非常不好的直译,很容易让人产生误解,人们可能会以为B-树和B树是两种树。 1、B树 1.1、B树产生的背景 不管是二叉树、二叉查找树还是平衡二叉树,它们都有诸多限制,比如: 每个结点只能存储一个元素。 ..

学无止境! 2468

B树,B+树,B*树以及R树的介绍

从B 树、B+ 树、B* 树谈到R 树   作者:July、weedge、Frankie。编程艺术室出品。 说明:本文从B树开始谈起,然后论述B+树、B*树,最后谈到R 树。其中B树、B+树及B*树部分由weedge完成,R 树部分由Frankie完成,全文最终由July统稿修订完成。 出处:http://blog.youkuaiyun.com/v_JULY_v 。   第一节、B树、B+树、B*

peterchan88的专栏 6752

B 树、B- 树、B+ 树和B* 树

B树 即二叉搜索树: 1. 所有非叶子结点至多拥有两个儿子(Left和Right); 2. 所有结点存储一个关键字; 3. 非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树; 如: B树的搜索,从根结点开始,如果查询的关键字与结点的关键字相等,那么就命中;否则,如果查询关键字比结点关键字小,就进入左儿子;如果比结点关键字大,就进入右儿子;如果左儿子或右儿子

idber的学习笔记 6997

B树(B-树 B_树)、B+树、B*树

B树 B-tree树即B树,B即Balanced,平衡的意思。因为B树的原英文名称为B-tree,而国内很多人喜欢把B-tree译作B-树,其实,这是个非常不好的直译,很容易让人产生误解。如人们可能会以为B-树是一种树,而B树又是另一种树。而事实上是,B-tree就是指的B树。特此说明。 先介绍下二叉搜索树 1.所有非叶子结点至多拥有两个儿子(Left和Right)...

艾斯-李的博客 3560

B-树、B+树、Trie树

B-树 性质: 是一种多路搜索树(并不是二叉的):            1.定义任意非叶子结点最多只有M个儿子;且M>2;            2.根结点的儿子数为[2, M];            3.除根结点以外的非叶子结点的儿子数为[M/2, M];            4.每个结点存放至少M/2-1(取上整)和至多M-1个关键字;(至少2个关键字)

Sunshine的专栏 1854

B树、B-树、B+树

B树 即二叉搜索树: 1.所有非叶子结点至多拥有两个儿子(Left和Right); 2.所有结点存储一个关键字; 3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树; 如: image.png ...

ii偏闹i的博客 2016
上一篇: 搜索算法
下一篇: find: ‘/run/user/1000/gvfs’: Permission denied解决办法
PyTtCcMm
博客等级 码龄8年 21粉丝 22原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值