225_16_binary_tree

225_16_binary_tree -...

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

View Full Document Right Arrow Icon
If you have a max-heap where the values in the heap are distinct,  and you want to find the smallest value in the heap: 1. Where can it be in the heap? 2. How much time does it take to find it? 3. What would you do if you wanted to delete it?
Background image of page 1

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

View Full DocumentRight Arrow Icon
Where could you put values 1-8?
Background image of page 2
3 Array positions of heap elements:
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Assignment 2: Part A due Wed. Oct. 12. Part B due Fri. Oct. 14. Midterm: Tues. Oct. 18, in class. Midterm tutorial:  Sunday Oct. 16, 1pm in ECS 116. Bring any questions you have about old midterm exams. No office hours Oct. 19-21 (at conference)  
Background image of page 4
5 http://www.nevron.com/Gallery.DiagramFor.NET.Symmetrical.aspx Lecture 11: Best Case  Binary Tree Sort
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Binary search tree:  If a node has key value x then -all keys in the left subtree have a data value which is less  than or equal to x, and - all keys in the right subtree have a data value which is  greater than  x.
Background image of page 6
7 If items are inserted one by one, the resulting tree can have  arbitrary shape:
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 http://scienceblogs.com/goodmath/upload/2007/01/unbalanced-trees.jpg
Background image of page 8
9 http://www.brpreiss.com/books/opus5/html/page304.html Worst Case  Shape Best Case  Shape
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 Inductive Definition of a Binary Search tree : A b ina ry s e a rc h tre e  is  b uilt up o f no de s  e a c h o f whic h ha s   a  ke y va lue , a  le ft c hild a nd a  rig ht c hild (whe re  the  c hildre n  a re  po inte rs  to  o the r no de s ).  [Basis] A tre e  with 0 no de s  is  a  b ina ry s e a rc h tre e  with ro o t 
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/15/2012 for the course CSC 225 taught by Professor Valerieking during the Spring '10 term at University of Victoria.

Page1 / 22

225_16_binary_tree -...

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

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