Hello! I want to implement a avltree using C++,and I have do most of it,except the remove() algorithm. My question is when should I rotate the tree in remove(). I hope that any body can represent the situation for me using the Pelple's language,because the implemented code depend on the data structure which you had used.

here ,I give you some of my code for a reference. In this code,all the avltree class's method could be used,except the remove().

main.cpp

is used to debug,and you can run it independent.
myt_avltree.h

is the hole class's head files.

By the way,there's another important question:
how to compile the template separately?
Would you use my code myt_avltree.h to give a example for me?

Help me to implement it,or give me some advances please.

Thank you very much!:) [INDENT]
[/INDENT]

Re: Help me to Implement the AVLtree's remove algorithm 80 80

I don't really know that much about AVL trees, but someone posted a link the other day to a site that has this. It looks pretty easy to follow, so I hope that helps you. :)

Re: Help me to Implement the AVLtree's remove algorithm 80 80

I don't really know that much about AVL trees, but someone posted a link the other day to a site that has this. It looks pretty easy to follow, so I hope that helps you. :)

Thank you very much!
But this page I have too,and I had read it.
Some important idears of my code referenced it,for example the "link[]". But my avltree's balance flag is different from it,so I can't solve the probolem use it.

Thank you all the same!;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.