Tutorial_11_v02-for-viewing-printing - insertion Based on...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CC2203 Data Structures and Algorithms Sem 2, 2009-2010 Tutorial 11 Instruction In this tutorial, you are required to submit your tutorial work answer for the exercises to me. Tutorial work will not be graded unless your coursework fails (coursework below D grade). If one’s coursework fails, that tutorial work will be graded to see if condone pass should be issued or not. Exercise 1 (a) Suppose the sequence of integers 23, 9, 17, 88, 3, 27, 30 is to be inserted into a binary search tree (BST). Then, the root of the BST contains the integer 23 after the first insertion. Draw the BST after inserting all the integers in that sequence. (b) Suppose for every node x of an AVL tree, its balance factor is computed as follows: balance factor of x = height of right subtree of x - height of left subtree of x Figure 1 shows the AVL tree containing the integer 23 with the balance factor 0 after the first
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: insertion. Based on Figure 1, draw the AVL tree and indicate the balance factors for all nodes after inserting the sequence of integers in part (a) of this question. Figure 1 (c) Draw the binary tree after deleting node 48 from the binary tree in Figure 2. Figure 2 (d) If preorder traversal is used to visit the binary tree in Figure 2, show the order of the nodes visited. CC2203 Data Structures and Algorithms Sem 2, 2009-2010 Review 1. Double-click bookprog.zip to extract bookprog folder. The bookprog folder contains all Java codes presented in the lectures. 2. Read the corresponding lecture slides ( Lecture Notes 12) for the compilation and execution. Understand those Java source codes, compile and execute them....
View Full Document

This note was uploaded on 08/18/2011 for the course COMP 3868 taught by Professor Keithchan during the Summer '97 term at Hong Kong Polytechnic University.

Page1 / 2

Tutorial_11_v02-for-viewing-printing - insertion Based on...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online