Page 1 of 1

Fill an empty BST with { 8, 13, 5, 18, 25, 7, 2 }. Then make the tree sorted ascending order for in order traversal (i.

Posted: Mon Jun 06, 2022 2:25 pm
by answerhappygod
Fill an empty BST with { 8, 13, 5, 18, 25, 7, 2 }. Then make the tree sorted ascending order for in order traversal (i.e. symmetric traversal). Mark nodes as Red or Black. Keep the balance factor for each node.
Insert { 10, 1, 9 }. After each insertion do the same: Mark nodes as Red or Black. Keep the balance factor for each node. When necessary according to balance factor, make the tree sorted ascending order for in order traversal (i.e. symmetric traversal).
Delete { 8, 5 }. After each deletion do the same: Mark nodes as Red or Black. Keep the balance factor for each node. When necessary according to balance factor, make the tree sorted ascending order for in order traversal (i.e. symmetric traversal).
These two websites and one PDF may help you understand.
https://www.cs.auckland.ac.nz/software/ ... black.html
https://appliedgo.net/balancedtree/
Red-Black Tree Processing.pdf
Upload your illustrations (can be hand drawn remember to designate Red Black write R B, and Node's Balance Factor)