






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







2-3 tree^ empty
S S L class Tree23Node{Object small; Object large;Tree23Node left; Tree23Node mid;Tree23Node right; }
boolean search(Object item){if(item == null) throw new NullPointerException(โโฆโ); if(isEmpty()) throw new TreeUnderflowException(โโฆโ);Comparable o = (Comparable)item; Tree23Node loc = root;while(loc!=null){ int comp = o.compareTo(loc.small);if(comp<0) loc = loc.left; else if(comp==0) return true;if(loc.large==null) loc = loc.middle; else{comp = o.compareTo(loc.large); if(comp<0) loc = loc.middle;else if(comp==0) return true; } else loc = loc.right; }return false; }
case i-1.
case i-2.
case i-3. case i-5.
case i-4.
2-3-4 treeempty T (^) L T (^) R T (^) L T (^) M T (^) R
insert(55)^60 40 80
10 15 20 50 65 70 90
insert(65)
delete(55) 10 15 20 50 65 70 90
delete(50)