Abstract
This paper proposes a new algorithm for rebalancing a binary search tree, called qBalance, by a certain analogy. The running time of this algorithm is proportional to the number of keys in the tree. To compare qBalance with existing rebalancing algorithms, several versions of the algorithm are implemented. We compare qBalance with the well-known DSW algorithm on binary search trees (BSTs), with the Sedgewick algorithm on an ordered tree, with the modified Sedgewick algorithm on Red-Black (RB) trees with the specific structure of the node. For RB trees whose nodes have a standard (typical) structure, qBalance is implemented using asynchronous mode. This version of the algorithm is considerably complicated, but it is twice as fast as the serial implementation. The results of numerical experiments confirm the advantage of the new algorithm compared to DSW. The Sedgewick algorithm and its modification retain advantage by 30% in terms of running time on ordered trees. On red-black trees, the advantage of the new algorithm is significant. This especially applies to the asynchronous version of the algorithm.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Day, C.: Comput. J. XIX, 360–361 (1976)
Stout, Q.F., Warren, B.L.: Commun. ACM 29(9), 902–908 (1986)
Sedgewick, R.: Algorithms in C, Parts 1–5. Addison-Wesley Professional, Boston (2001)
Gelashvili, K., Grdzelidze, N., Shvelidze, G.: The modification of the Sedgewick’s balancing algorithm. Bull. Georgian Acad. Sci. 10(3), 60–67 (2016)
Pfaff, B.: An Introduction to Binary Search Trees and Balanced Trees. Libavl Binary Search Tree Library, vo.1.1: Source Code Ver. 2.0.2 (2004)
Rolfe, J.T.: One-time binary search tree balancing: the Day/Stout/Warren (DSW) algorithm. SIGCSE Bull. 34, 85–88 (2002)
Amdahl, G.M.: Validity of the single processor approach to achieving large-scale computing capabilities. In: AFIPS Conference Proceedings, pp. 483–485. AFIPS Press, Atlantic City (1967)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Gelashvili, K., Grdzelidze, N., Tutberidze, M. (2019). On New Rebalancing Algorithm. In: Kotsireas, I., Pardalos, P., Parsopoulos, K., Souravlias, D., Tsokas, A. (eds) Analysis of Experimental Algorithms. SEA 2019. Lecture Notes in Computer Science(), vol 11544. Springer, Cham. https://doi.org/10.1007/978-3-030-34029-2_8
Download citation
DOI: https://doi.org/10.1007/978-3-030-34029-2_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-34028-5
Online ISBN: 978-3-030-34029-2
eBook Packages: Computer ScienceComputer Science (R0)