I don't understand the requirements for a red-black tree.(adsbygoogle = window.adsbygoogle || []).push({});

Using this photo:

https://upload.wikimedia.org/wikipedia/commons/6/66/Red-black_tree_example.svg

One of the 5 required properties is that all leaves are black.

A leaf is a node without a child, so that would only be 11 and 15 two links down from the root. So why is 1 and 25 black? They clearly have a child, so they are not leaves. Similarly, why is 6, 22, and 27 not black. They don't have children so they should be black.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Red-black Trees properties

Loading...

Similar Threads - black Trees properties | Date |
---|---|

C/++/# 3d space filling tree | Apr 5, 2017 |

Minimum Spanning Tree in R | Mar 3, 2017 |

Different Node Deletion/Insertion in a Binary Search Tree | Oct 23, 2016 |

C/++/# Djikstra's algorithm with distance 1 between every node | Sep 25, 2016 |

Decision Properties of Languages | Jan 11, 2015 |

**Physics Forums - The Fusion of Science and Community**