



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!




PROF.parmeet kaur Mandeep kaur
left_subtree (keys)Operations on Binary search tree: ≤ node (key) ≤ right_subtree (keys)
Else { Parent.left = node;} Return root; Example: 13, 3, 4, 12, 14, 10, 5, 1, 8, 2, 7, 9, 11, 6, 18
Case2: Node to be deleted having two child Algorithm: [Find SUC and PARSUC], which points to inorder successor of N and parent successor points to parent node of inorder successor. a. Set PTR= RIGHT[LOC] and save[LOC] b. Repeat while LEFT[PTR]≠ NULL SET SAVE = PTR AND PTR = LEFT[PTR] [end while] c. Set SUC = PTR AND PARSUC = SAVE Step2: Call the CASEA(INFO, LEFT, RIGHT, ROOT, SUC, PARSUC) Step3: a. if PAR≠ NULL then If LOC = LEFT[PAR] then