procedure insertion( : binary search tree, : item)
root of
{a vertex not present in has the value null }
while and
if then
if left child of then left child of
else add new vertex as a left child of and set
else
if right child of then right child of
else add new vertex as a right child of and set
if root of then add a vertex to the tree and label it with
else if is null or then label new vertex with and let be this new vertex
return { = location of }
Header Image
Creative Commons image courtesy of Flickr user StormPetrel1-
Recent Posts
Recent Comments
- In the Spotlight: MAT2540 – Discrete Structures and Algorithms II – The Open Road on Links
- OpenLab Workshop for Opening Gateways Fellows | 2018-2019 Opening Gateways Faculty Seminar on Final Exam Review
- Eric on Eric’s Final Review
- Kate Poirier on Hints/reminders from today’s class
- Kate Poirier on Final Exam Review
Archives
Categories
Meta