Interval and q overlap done otherwise if vleftchildmax

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: c,4 b,6 A Variant—Search • Search for an interval that has an overlap with Q = [l,r] If v.interval and Q overlap, done. Otherwise, if v.leftChild.max >= l search v.leftChild. Otherwise search v.rightChild. f,7 e,4 a,3 d,7 c,4 b,6 A Variant—LL Rotation A B B B’L B’L AR BR After insertion. BR AR After rotation. • Max values changes only for A and B. A.max = max{BR.max, AR.max}. B.max = max{B’L.max, A.max}. A Remaining Rotations • All insert/delete rotations require computing max for O(1) nodes. • O(1) rotations per insert/delete. • Complexity of insert/delete is O(log n)....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online