Quiz 4


22 July

Insert the following integers into a BST (in L-->R order). Show the tree after each insertion.

10, 12, 14, 8, 9, 7

Solution

  1.       O 10
    
  2.       O 10
           \
            O 12
    
  3.       O 10
           \
            O 12
             \
              O 14 
    
  4.       O 10
         / \
      8 O   O 12
             \
              O 14 
    
  5.       O 10
         / \
      8 O   O 12
         \   \
          O 9 O 14 
    
  6.       O 10
         / \
      8 O   O 12
       / \   \
    7 O   O 9 O 14 
    

Last updated : 22 July 1999 3:11pm