views:

762

answers:

3

I am searching for a proof that all AVL trees can be colored like a red-black tree? Can anyone give the proof?

+1  A: 

Ok, ik give you a hint

Have a look at: AVL Tree and Red black Tree, if you understand that, the proof should be trivial.

Gamecat
A: 

I suspect the answer is no.

AVL trees balance better than RB trees, which means they balance differently, which would rather imply that you could not colour every AVL tree as a valid RB tree.

Blank Xavier
This is incorrect. The only substantial difference is that the AVL tree's balancing is more strict, and no tree can be "too balanced" to be a red-black tree.
Graphics Noob
Would it not be possible to have an AVL tree, which if you coloured it, would be in a state which is invalid for a RB tree? that is my concern.
Blank Xavier
A: 

The answer is yes, every AVL tree can be colored Red-Black, and the converse doesn't hold.

I haven'y exactly figured out HOW to do it tho, and am also seeking the proof.