When node z has two children, we arbitrarily decided to replaceit with its successor. We could just as well replace it with itspredecessor. (Some have argued that if we choose randomly betweenthe two options we will get more balanced trees.) RewriteTREE-DELETE to use the predecessor rather than the successor.Modify the above code just as you need to and underline or boldfacethe changed portions.
Expert Answer
An answer will be send to you shortly. . . . .