Java Visitor Pattern

  • + 1 comment

    A Node is any element in a tree. A leaf is any element in a tree that has no children. The code you pasted above creates a Node or a Leaf accordingly.

    HackerRank solutions.