This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tree of BST - the algorithm to remove an item  RSS feed

 
Andrzej Sydor
Greenhorn
Posts: 8
Android Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!