func (d *DAG) NewNode(id string, parents []string) {
	d.parents[id] = parents
	for _, parentID := range parents {
		d.children[parentID] = append(d.children[parentID], id)
		d.leaves[parentID] = false
	}
	if _, ok := d.leaves[id]; !ok {
		d.leaves[id] = true
	}
}
func (d *DAG) NewNode(id string, parents []string) {
	d.parents[id] = parents
	for _, parentID := range parents {
		d.children[parentID] = append(d.children[parentID], id)
		d.leaves[parentID] = false
	}
	if _, ok := d.leaves[id]; !ok {
		d.leaves[id] = true
	}
}
func ( d * DAG ) NewNode ( id string , parents [ ] string ) { d . parents [ id ] = parents for _ , parentID := range parents { d . children [ parentID ] = append ( d . children [ parentID ] , id ) d . leaves [ parentID ] = false } if _ , ok := d . leaves [ id ] ; ! ok { d . leaves [ id ] = true } }
// NewNode adds a node to d.
NewNode adds a node to d .