BST Algorithm
I am trying to design an algorithm that will remove the second largest value from a Binary Search Tree with time of O(height). Can anyone give me some insight witht this? It doesn't seem like it should be that hard but I think I am just hitting a mental block.
First off, thank you for the input!I don't think the first will do exactly what I want because it won't preserve the original formation of the BST. The second I believe should work though I am not positive that its time is O(height). Is it?