lkml.org 
[lkml]   [2021]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject答复: 答复: [PATCH] rbtree: stop iteratio n early in rb find first
Date








 
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







\
 
 \ /
  Last update: 2021-08-25 20:27    [W:0.124 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site