Computer Science, asked by keerthiveera1304, 2 months ago

Identity the valid red black tree

Answers

Answered by ka371973m2
0

Answer:

Properties of a red-black tree

Each tree node is colored either red or black.

The root node of the tree is always black.

Every path from the root to any of the leaf nodes must have the same number of black nodes.

No two red nodes can be adjacent, i.e., a red node cannot be the parent or the child of another red node.

Answered by Bonani11
0

Explanation:

A red-black tree is a Binary tree where a particular node has color as an extra attribute, either red or black. By check the node colors on any simple path from the root to a leaf, red-black trees secure that no such path is higher than twice as long as any other so that the tree is generally balanced.

red-black tree is a binary search tree which has the following red-black properties:

Every node is either red or black.

Every leaf (NULL) is black.

If a node is red, then both its children are black.

Every simple path from a node to a descendant leaf contains the same number of black nodes

Similar questions