Messages in this thread | | | From | "Li,Rongqing" <> | Subject | 答复: 答复: [PATCH] rbtree: stop iteratio n early in rb find first | Date | Wed, 25 Aug 2021 18:26:59 +0000 |
| |
On Wed, Aug 25, 2021 at 04:01:53PM +0000, Li,Rongqing wrote: > > >> > >> > >> 10 > >> / > >> 5 > >> \ > >> 10
>That again breaks the above case.
10 / 5 \ 10
the above case should not exist. like below, when second 10 is inserted, it should be inserted to right leaf 10 / 5
as a result, it should be
10 / \ 5 10
since 10 is not less 10, so new 10 is inserted to right. and it depends on bool (*less)(struct rb_node *, const struct rb_node *) which not return true when equal
this case should be ok 10 \ 12 / 10
-Li
| |