setParentPointers function

void setParentPointers(
  1. Node node, [
  2. Node? parent
])

Implementation

void setParentPointers(Node node, [Node? parent]) {
  node.parent = parent;
  node.forEach((child) => setParentPointers(child, node));
}