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]

Recommended Answers

All 2 Replies

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. :)

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.