Skip to main content
ICT
Lesson AB30 - Binary Search Trees
 
Main   Previous Next
 

C. Shape of a Binary Tree page 5 of 15

  1. The shape of a binary tree will affect its performance as a data structure and is dependent on the initial order of the data set used to build the tree.

  2. If the data set is already sorted (1 2 3 4...), the binary tree is essentially a linked list with an unused left pointer in each node.

  3. A data set in random order will lead to a more balanced tree.

  4. Ideally, we want binary trees that are balanced with almost equal numbers of nodes in each subtree of every node. A balanced binary tree is defined as follows:

    For every node in the tree, the number of nodes in its left subtree is equal to the number of nodes in its right subtree, plus or minus one.

    Please note: Balancing binary trees will not be covered in this curriculum.

 

Main   Previous Next
Contact
 © ICT 2006, All Rights Reserved.