This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Tree of BST - the algorithm to remove an item Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Tree of BST - the algorithm to remove an item" Watch "Tree of BST - the algorithm to remove an item" New topic
Author

Tree of BST - the algorithm to remove an item

Andrzej Sydor
Greenhorn

Joined: Apr 12, 2011
Posts: 8

I have such an algorithm (inspired from a book about algorithms Cormen):


Does anyone can tell me, why is not working properly?
And how to do that work?

The problem is the removal of the item to the parent and two children (in other cases more work):
that is, it looks something like this:


In this example, remove an item '3 ', and removed the link but I'm losing, that is, if it looks like this:

instead of


What this is wrong?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tree of BST - the algorithm to remove an item
 
It's not a secret anymore!