rbtree.c (9e8238020c5beba64e7ffafbb7ea0fb02fe68270) | rbtree.c (d89775fc929c5a1d91ed518a71b456da0865e5ff) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 Red Black Trees 4 (C) 1999 Andrea Arcangeli <andrea@suse.de> 5 (C) 2002 David Woodhouse <dwmw2@infradead.org> 6 (C) 2012 Michel Lespinasse <walken@google.com> 7 8 9 linux/lib/rbtree.c 10*/ 11 12#include <linux/rbtree_augmented.h> 13#include <linux/export.h> 14 15/* | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 Red Black Trees 4 (C) 1999 Andrea Arcangeli <andrea@suse.de> 5 (C) 2002 David Woodhouse <dwmw2@infradead.org> 6 (C) 2012 Michel Lespinasse <walken@google.com> 7 8 9 linux/lib/rbtree.c 10*/ 11 12#include <linux/rbtree_augmented.h> 13#include <linux/export.h> 14 15/* |
16 * red-black trees properties: http://en.wikipedia.org/wiki/Rbtree | 16 * red-black trees properties: https://en.wikipedia.org/wiki/Rbtree |
17 * 18 * 1) A node is either red or black 19 * 2) The root is black 20 * 3) All leaves (NULL) are black 21 * 4) Both children of every red node are black 22 * 5) Every simple path from root to leaves contains the same number 23 * of black nodes. 24 * --- 606 unchanged lines hidden --- | 17 * 18 * 1) A node is either red or black 19 * 2) The root is black 20 * 3) All leaves (NULL) are black 21 * 4) Both children of every red node are black 22 * 5) Every simple path from root to leaves contains the same number 23 * of black nodes. 24 * --- 606 unchanged lines hidden --- |