Revisiting 2–3 red–black trees with a pedagogically sound yet efficient deletion algorithm: parity-seeking

IF 0.4 4区 计算机科学 Q4 COMPUTER SCIENCE, INFORMATION SYSTEMS
Kamaledin Ghiasi-Shirazi, Taraneh Ghandi, Ali Taghizadeh, Ali Rahimi-Baigi
{"title":"Revisiting 2–3 red–black trees with a pedagogically sound yet efficient deletion algorithm: parity-seeking","authors":"Kamaledin Ghiasi-Shirazi,&nbsp;Taraneh Ghandi,&nbsp;Ali Taghizadeh,&nbsp;Ali Rahimi-Baigi","doi":"10.1007/s00236-023-00452-6","DOIUrl":null,"url":null,"abstract":"<div><p>Red–black (RB) trees are one of the most efficient variants of balanced binary search trees. However, they have often been criticized for being too complicated, hard to explain, and unsuitable for pedagogical purposes, particularly their delete operation. Sedgewick (in: Dagstuhl Workshop on Data Structures, 2008. https://sedgewick.io/wp-content/themes/sedgewick/papers/2008LLRB.pdf) identified the length of code as the root of the problems and introduced left-leaning red–black (LLRB) trees. The delete operation of LLRB trees has a compact recursive code. Unfortunately, it may perform many unnecessary operations. The crux of the deletion algorithm is dealing with a “deficient” subtree, that is one whose black-height has become one less than that of its sibling subtree. In this paper, we revisit 2–3 red–black trees and propose a parity-seeking delete algorithm with the basic idea of making a deficient subtree on a par with its sibling: either by fixing the deficient subtree or by turning the sibling deficient as well, ascending deficiency to the parent node. Interestingly, the proposed parity-seeking <i>delete</i> algorithm also works for 2–3–4 RB trees. Our experiments show that the proposed parity-seeking delete algorithm is as efficient as the best preceding RB trees. The proposed parity-seeking delete algorithm is easily understandable and suitable for pedagogical and practical purposes.</p></div>","PeriodicalId":7189,"journal":{"name":"Acta Informatica","volume":"61 3","pages":"199 - 229"},"PeriodicalIF":0.4000,"publicationDate":"2024-03-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Acta Informatica","FirstCategoryId":"94","ListUrlMain":"https://link.springer.com/article/10.1007/s00236-023-00452-6","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0

Abstract

Red–black (RB) trees are one of the most efficient variants of balanced binary search trees. However, they have often been criticized for being too complicated, hard to explain, and unsuitable for pedagogical purposes, particularly their delete operation. Sedgewick (in: Dagstuhl Workshop on Data Structures, 2008. https://sedgewick.io/wp-content/themes/sedgewick/papers/2008LLRB.pdf) identified the length of code as the root of the problems and introduced left-leaning red–black (LLRB) trees. The delete operation of LLRB trees has a compact recursive code. Unfortunately, it may perform many unnecessary operations. The crux of the deletion algorithm is dealing with a “deficient” subtree, that is one whose black-height has become one less than that of its sibling subtree. In this paper, we revisit 2–3 red–black trees and propose a parity-seeking delete algorithm with the basic idea of making a deficient subtree on a par with its sibling: either by fixing the deficient subtree or by turning the sibling deficient as well, ascending deficiency to the parent node. Interestingly, the proposed parity-seeking delete algorithm also works for 2–3–4 RB trees. Our experiments show that the proposed parity-seeking delete algorithm is as efficient as the best preceding RB trees. The proposed parity-seeking delete algorithm is easily understandable and suitable for pedagogical and practical purposes.

Abstract Image

用一种教学合理而高效的删除算法重新审视 2-3 红黑树:奇偶性搜索
红黑(RB)树是平衡二叉搜索树中最有效的变种之一。然而,它们经常被批评过于复杂、难以解释,而且不适合教学目的,尤其是删除操作。Sedgewick (in:达格施图尔数据结构研讨会,2008 年。https://sedgewick.io/wp-content/themes/sedgewick/papers/2008LLRB.pdf)认为代码长度是问题的根源,并引入了左倾红黑树(LLRB)。LLRB 树的删除操作具有紧凑的递归代码。遗憾的是,它可能会执行许多不必要的操作。删除算法的关键在于处理 "缺失 "子树,即其黑色高度比同级子树的黑色高度少一个的子树。在本文中,我们重新审视了 2-3 个红黑树,并提出了一种奇偶性搜索删除算法,其基本思想是使有缺陷的子树与其同胞子树处于同等位置:要么修复有缺陷的子树,要么将同胞子树也变成有缺陷的,缺陷程度依次递增至父节点。有趣的是,所提出的奇偶性搜索删除算法也适用于 2-3-4 RB 树。我们的实验表明,所提出的奇偶校验搜索删除算法的效率不亚于之前的最佳 RB 树。所提出的奇偶校验寻求删除算法易于理解,适合教学和实际应用。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Acta Informatica
Acta Informatica 工程技术-计算机:信息系统
CiteScore
2.40
自引率
16.70%
发文量
24
审稿时长
>12 weeks
期刊介绍: Acta Informatica provides international dissemination of articles on formal methods for the design and analysis of programs, computing systems and information structures, as well as related fields of Theoretical Computer Science such as Automata Theory, Logic in Computer Science, and Algorithmics. Topics of interest include: • semantics of programming languages • models and modeling languages for concurrent, distributed, reactive and mobile systems • models and modeling languages for timed, hybrid and probabilistic systems • specification, program analysis and verification • model checking and theorem proving • modal, temporal, first- and higher-order logics, and their variants • constraint logic, SAT/SMT-solving techniques • theoretical aspects of databases, semi-structured data and finite model theory • theoretical aspects of artificial intelligence, knowledge representation, description logic • automata theory, formal languages, term and graph rewriting • game-based models, synthesis • type theory, typed calculi • algebraic, coalgebraic and categorical methods • formal aspects of performance, dependability and reliability analysis • foundations of information and network security • parallel, distributed and randomized algorithms • design and analysis of algorithms • foundations of network and communication protocols.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信