Assignments | Course Home | Documentation | Lab Hours/Tutoring | Schedule | Submit

Saint Louis University

Computer Science 180
Data Structures

Michael Goldwasser

Spring 2014

Dept. of Math & Computer Science

Homework Assignment 07

Balanced Trees

Contents:


Overview

Topic: Balanced Trees
Related Reading: Ch. 10.1, 10.2
Due: Friday, 2 May 2014, 10:00am

Please make sure you adhere to the policies on academic integrity.


Problems to be Submitted (20 points)

  1. (5 points)

    Using a standard binary search tree (i.e., without any rebalancing operations), draw the final tree that results after the following sequence of insertions: 30, 40, 24, 58, 48, 26, 11, 13.

  2. (5 points)

    Draw the final AVL tree that results after inserting the sequence of elements 10, 20, 30, 40, 50, 60, in that order.

    Just above each node of your drawing, provide an annotation of the height of the subtree rooted at that node, using a convention that a node with two null children has height 1 (i.e., in this example, immediately after 10 is inserted, the root of the tree has height 1).

  3. (5 points)

    Continuing where you left off with the preceding problem, show the final result after the additional insertions 70, 80, 90, 100.

    Just above each node of your drawing, provide an annotation of the height of the subtree rooted at that node, using a convention that a node with two null children has height 1.

  4. (5 points)

    Draw the AVL tree that results from the deletion of value 15 from the following AVL tree

    Just above each node of your drawing, provide an annotation of the height of the subtree rooted at that node, using a convention that a node with two null children has height 1.


Michael Goldwasser
CSCI 180, Spring 2014
Last modified: Monday, 30 April 2012
Assignments | Course Home | Documentation | Lab Hours/Tutoring | Schedule | Submit