codelike-logo
Red Black Tree Visualization
Red Black Tree

Read Black Tree

Understand red-black trees

1) Tree root nodes are always black node

2) All node are red and black.

3) Two consecutive reds node are not found in similar path. Parent node and child node.

4) Similar number of black nodes are existed in all tree path.

5) Leaf node are represented as black node.

Example of RB Tree

View insertion [10 20 30 5 3 7 6 4 5 2 ] Try it yourself

1020305376452

Example of red black tree

View insertion [90 80 70 60 50 40 20 55 ] Try it yourself

9080706050402055

View insertion [10 70 32 34 13 56 32 56 21 3 62 4 ] Try it yourself

1070323413563256213624
8425784245633521234553356356742

View insertion


Comments