How do you do a REMOVAL in an AVL tree?

N

Nobody

I've got a Binary Search Tree all completed, and now I am trying to derive
an AVL Tree from it. I've got all the functions figured out except the
removal. Haven't got a clue on an algorithm to do this. Obviously, I remove
the node and all of its sub nodes and then balance the tree. Or do I remove
the node & sub nodes "in order" balancing the tree as I go?
 
D

Dave O'Hearn

Nobody said:
I've got a Binary Search Tree all completed, and now I am trying
to derive an AVL Tree from it. I've got all the functions figured
out except the removal. Haven't got a clue on an algorithm to do
this. Obviously, I remove the node and all of its sub nodes and
then balance the tree. Or do I remove the node & sub nodes "in
order" balancing the tree as I go?

This is not a good newsgroup for general questions about data
structures. In C++, most of us would use a container from the standard
library, such as std::map. If you have specific problems getting your
code to compile though, then feel free to ask here.

You could also try comp.programming for general questions like this, or
just Google for "AVL tree".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top