Question: Problem 2 [ 1 8 pts ( 3 each ) ] : Family Tree The root of the Tree above is node F . A

Problem 2[18 pts (3 each)]: Family Tree
The root of the Tree above is node F .
A neighbor of node X is any node which shares an edge with X (e.g. G and I are
neighbors while H and E are not).
A nodes parent is the unique neighbor which is closer to the root (the root has no
parent). For example, Bs parent is F .
A sibling of node X is any node which shares a parent with X.
An ancestor of node X is any node on the path from X to the root.
X is a descendent of Y if Y is an ancestor of X.
Assume that the sibling, neighbor, ancestor and descendent relation are reflexive (e.g. every
node is its own sibling) while the parent and child relations are not (no node is its own
parent).
Express the set all the nodes which meet each of the following criteria.
i Child of D
ii Parent of I
iii Sibling of D
iv Ancestor of H
v Descendent of B
vi the set of Neighbors of D or G which are not also neighbors of B
2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!