Sunday, March 9, 2014

Week 8 Slog

This week we study the BST what is Binary Search Tree. BST is different with Binary Tree(BT). The BST must is a BT, but the BT is not BST. A BST's node must has a value and every node value is greater than the values of all nodes in its left subtree, and less than the values of all nodes in its right subtree.There is a example to show how do the BST work:

BST:
                  8
        2                10
                      5         11
                  3      6

if we research the number 12, 
then we follow this order:  8  is less than 12, then turn right it is 10, and it also less than 12, then turn right it is 11 , but it is less than 12, and 11 has no right ,so this BST has no number 12.

As you can see, the BST is easy to research any numbers.

No comments:

Post a Comment