Рет қаралды 41,135
Red black tree construction with example
Rules
1.root node should be black
2.new leaf node should be red
3.if parent of newnode is black then continue. With another insertion
4.if parent of new node is red then check colour of parents sibling
a)if sibling in black or no sibling then do suitable rotations like AVL tree and continue
b)if sibling is red then recolour parent and parents sibling and also check if grand parent of leaf node is not root node then recolour grand parent and recheck again else continue
#redblacktree
#datastructures
#education
#btech
#cse #it
#college
#Students lecture