An Immediate Approach to Balancing Nodes of Binary Search Trees
نویسنده
چکیده
We present an immediate approach in hoping to bridge the gap between the difficulties of learning ordinary binary search trees and their height-balanced variants in the typical data structures class. Instead of balancing the heights of the two children, we balance the number of their nodes. The concepts and programming techniques required for the node-balanced tree are much easier than the AVL tree or any other height-balanced alternatives. We also provide a very easy analysis showing that the height of a nodebalanced tree is bounded by c log n with c ≈ 1. Pedagogically, as simplicity is our main concern, our approach is worthwhile to be introduced to smooth student’s learning process. Moreover, our experimental results show that node-balanced binary search trees may also be considered for practical uses under some reasonable conditions.
منابع مشابه
A Randomized Self-Adjusting Binary Search Tree
We present algorithms for a new self-adjusting binary search tree, which we call a shuffle tree. The tree is easy to implement and does not require parent pointers or balancing information to be stored in tree nodes. A maximum of one rotation is probabilistically applied during each traversal, which keeps the cost of balancing activity low. We present tests to compare the performance of shuffle...
متن کاملWS 2007/2008 Fundamental Algorithms
1. (a,b)-Trees As we saw in the previous section, the efficiency of standard operations on binary search trees depends on the maximum tree height. Using height balancing, we ensure that trees cannot degenerate linearly but instead have logarithmic height. Let us extend this approach to more general trees. Motivation: assume tree nodes are stored in secondary storage (hard disk). Comparisons of ...
متن کاملProfile and Height of Random Binary Search Trees
The purpose of this article is to survey recent results on distributional properties of random binary search trees. In particular we consider the profile and the height.
متن کاملProbabilistic analysis of the asymmetric digital search trees
In this paper, by applying three functional operators the previous results on the (Poisson) variance of the external profile in digital search trees will be improved. We study the profile built over $n$ binary strings generated by a memoryless source with unequal probabilities of symbols and use a combinatorial approach for studying the Poissonized variance, since the probability distribution o...
متن کاملA New Method for Clustering Wireless Sensor Networks to Improve the Energy Consumption
Clustering is an effective approach for managing nodes in Wireless Sensor Network (WSN). A new method of clustering mechanism with using Binary Gravitational Search Algorithm (BGSA) in WSN, is proposed in this paper to improve the energy consumption of the sensor nodes. Reducing the energy consumption of sensors in WSNs is the objective of this paper that is through selecting the sub optimum se...
متن کامل