Skip to content

Add post-order traversal #61

@VEZY

Description

@VEZY

Currently, we only provide pre-order tree traversal, which applies the function from the root to the leaves. We should also provide the reverse, applying the function to the leaves first and then going to the root.

See: AbstractTrees.PreOrderDFS and AbstractTrees.PostOrderDFS.

I propose that we re-export those two and that users provide them as an argument to the tree traversal. The only thing we have to change is when we call the function in the traversal:

  • before recursion on the children for PreOrderDFS
  • after recursion for PostOrderDFS

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