Tutorial_11_v02-for-viewing-printing

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

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

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

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

View Full Document
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern