Skip to content

Module 5: FTree is incorrect #37

Description

@xgillard

**This issue relates to #35 ** (should probably be a subtask of it).

The FTree expects a depth of 0 for leaves. This is not correct as a leaf is a (sub)tree comprising one single node. Therefore, it has a depth 1.

Also, rather than relying on left() == null && right() == null it would be better if all nodes implemented an isLeaf() method. That way, leaves could be a Tree implementation totally separated from the Node class. This would be way more functional (akin to the Nil in functional lists).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions