Skip to content

Red-Black tree iterator increment #5

@MikeGWem

Description

@MikeGWem

The iterator increment method for a Red-Black Tree has an edge case that fails to change the node pointer. If the current node of the iterator is the root and there are no right hand children (and obviously no parent) then the node referenced by the iterator does not change. This means that iterations are effectively halted with the code potentially looping.

I hit the same thing when testing a version I had written and thought I would check the "master version" so to speak.

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