平衡树——2-3树(Binary Search Tree - 2-3 Tree)

2-3树是具有特殊性质的二叉搜索树,节点可以存储1到3个元素,最多拥有3个子节点。插入元素时,如果节点已满则进行分裂操作,保持树的平衡。搜索、插入和删除操作的时间复杂度为O(logn)。通过示例展示了如何构建2-3树。
摘要由CSDN通过智能技术生成

平衡树——2-3树(Binary Search Tree - 2-3 Tree)


简介(Introduction)
2-3 trees and 2-3-4 trees are binary search trees that allow one node have more than one items stored.

For BSTs, a node that holds a single item has at most two children. It is called 2-node.

For 2-3 tree, a node that can hold two items has at most three children. It is called 3-node.

For 2-3-4 tree, a node that can hold three items has at most four children. It is called 4-node.
这里写图片描述

构造2-3树(Building 2-3 tree)
We can build a 2-3 tree by inserting item one by one. To insert a key k, we pretend to search for it. This will take us to a leaf node in the tree, wh

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值