q14GetAllAncestors
solutions.q14GetAllAncestors
Question 14
Given a DAG \(G(V,E)\), WAP to determine the list of ancestors for each node.
Functions:
| Name | Description |
|---|---|
q14GetAllAncestors |
Args: |
q14GetAllAncestors(G)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
G
|
Graph
|
Graph resolves into |
required |