SUNY Geneseo Department of Computer Science


Deleting from Ordered Trees

{Date}

CSci 141, Spring 2005
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

I'm out of town next Thursday and Friday

Questions?

Deletion from Ordered Trees

Section 13.5.1

Problem: can't just replace node with its children because there are too many children

But if only one child, parent can be replaced

Otherwise preserve structure of tree by replacing root with largest node less than one being deleted, which must have only one child, to the left

Example

Examples

[Deletion Rearranges Nodes in a Tree]

Performance of Deletion

Tree of n items, height h

Balanced trees

Consider search plus actual deletion

Other cases (best, worst-worst)

[An Unbalanced Tree Looks Like a Zizag List]

Next

Limits of computing

Look at some very expensive algorithms

Read Section 15.1


Next Lecture