Skip to content

Some very serious error at page 184 #84

@Fantasy-Rain

Description

@Fantasy-Rain

Those nil's are considered as nodes when calculation, but not included in data_nodes(T)=n.

So given a red-black tree T with n data nodes, the two highlighted parts should be: log(n+1)+1, log(n+1).

Then height(T)= ((log(n+1)+1)+log(n+1)) - 1= 2log(n+1). (when calculating height, nil's are included; both CLRS, GeeksForGeeks gives the same result.)

This error has to be fixed immediately.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions