Are AVL trees always a subset of red black trees?

Am I looking for evidence that all AVL trees can be painted like red-black wood? Can anyone give evidence?

+3
source share
4 answers

By definition, R / B trees may be slightly less balanced, then AVL-s, as | maxPath - minPath | must be <= 1 for AVL and maxPath <= 2 * minPath for R / Bs, so not every R / B is AVL, but on the other hand, there is no need for AVL-s. To have Empty subTrees, therefore

     4
    / \
   3   6
  /\   /\
 1  E 5  8

- AVL, R/B, R/B , - . R/B, x node E x E : R/B:    BST    , ,    node    -    node,    node,   . T ≤ 2 * T

Btw , - . Karol

+1

, ik

: AVL , , .

-1

I suspect the answer is no.

AVL trees are better than RB trees, which means they balance in different ways, which rather means that you cannot color each AVL tree as a valid RB tree.

-one
source

The answer is yes, each AVL tree can be painted Red-Black, but the opposite is not true.

I definitely did not understand HOW to do this, and I am also looking for evidence.

-one
source

All Articles