class Node { constructor(data) { this.data = data; this.children = []; } add(data) { this.children.push(new Node(data)); } remove(data) { this.children = this.children.filter((child) => child.data === data ? false : true ); } } class Tree { constructor() { this.root = null; } BFS(fn) { if (this.root === null) return; const unvisitedQueue = [this.root]; while (unvisitedQueue.length !== 0) { const..