This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: – Faster to do iteratively • Fastest methods are careful to limit # of comparisons CS2134 Other operations on binary search trees • Insertion – Assume don’t allow duplicate elements in tree – Insertion is like search, but when reach NULL, insert new node there containing element – Shape of tree depends on order of insertions • Deletion – Trickier – Find node to delete – If no children, remove (need to change parent) – If one child, attach that child to node’s parent – If two children, replace node with its successor...
View
Full
Document
This note was uploaded on 12/09/2009 for the course CS 2134 taught by Professor Hellerstein during the Spring '07 term at NYU Poly.
 Spring '07
 Hellerstein
 Algorithms, Binary Search, Data Structures

Click to edit the document details