Skip to content

Instantly share code, notes, and snippets.

@hochgi
Last active June 16, 2021 07:01
Show Gist options
  • Save hochgi/e9943877cc025b41416f580a10ecd67a to your computer and use it in GitHub Desktop.
Save hochgi/e9943877cc025b41416f580a10ecd67a to your computer and use it in GitHub Desktop.
Tree parsing exercise java
package scratch.example;
import java.util.List;
public class Tree {
int value;
List<Tree> children;
public Tree(int value, List<Tree> children) {
this.value = value;
this.children = children;
}
}
package scratch.example;
import java.util.Optional;
public interface TreeFormatter {
String format(Tree tree);
Optional<Tree> parse(String in);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment