Skip to content

Level (or depth) of a node #17

Open
@giacomoratta

Description

@giacomoratta

When I use the Iterator, I would want to know the level of a node.
Is there a (low complexity) way to have the level of a node?

Level: "The level of a node is defined as: 1 + the number of edges between the node and the root."
Depth: "The depth of a node is the number of edges from the tree's root node to the node."
(from Wikipedia)

Would be also interesting to have other characteristics about the tree:

  • is Branch node (or is Internal node)
  • Height of node
  • Height of tree
  • Depth

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