An immediate approach to balancing nodes in binary search trees

  • Authors:
  • Chung-Chih Li

  • Affiliations:
  • Lamar University, Beaumont, TX

  • Venue:
  • Journal of Computing Sciences in Colleges
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present an immediate approach in hoping to bridge the gap between the difficulties of learning ordinary Binary Search Trees (henceforth BST) and their height-balanced variants in the typical data structures class. For each node in the tree, instead of balancing the heights of the two children, we balance the number of their nodes. The concepts and programming techniques required are much easier than the AVL tree or any other height-balanced alternatives. We also show that the height of a node-balanced tree is bounded by c log n with c ≈ 1. Because of its simplicity, our approach is pedagogically worthwhile to be introduced in the class to smooth student's learning process. Our experimental results also show that node-balanced BST may also be considered for practical uses under some reasonable conditions.