package com.thealgorithms.datastructures; import java.util.ArrayList; import java.util.List; public class Node { private final T value; private final List> children; public Node(final T value) { this.value = value; this.children = new ArrayList<>(); } public Node(final T value, final List> children) { this.value = value; this.children = children; } public T getValue() { return value; } public void addChild(Node child) { children.add(child); } public List> getChildren() { return children; } }