We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hello, IMHO test-case 1 (at least, I did not continued my analysis) is bad.
A tree is a DAG, meaning Directed Acyclic Graph and each node must have exactly one parent.
So, I assumed edges are directed from left to right (because the root node 1 is on the left)
Node 2 is not reachable from any other, knowing that node 1 is the root, as specified. Node 4 has two parents: 1 and 2 because it gives edges: 1 4 and 2 4. So I abandon solving this ...
Java Visitor Pattern
You are viewing a single comment's thread. Return to all comments →
Hello, IMHO test-case 1 (at least, I did not continued my analysis) is bad. A tree is a DAG, meaning Directed Acyclic Graph and each node must have exactly one parent. So, I assumed edges are directed from left to right (because the root node 1 is on the left) Node 2 is not reachable from any other, knowing that node 1 is the root, as specified. Node 4 has two parents: 1 and 2 because it gives edges: 1 4 and 2 4. So I abandon solving this ...
https://en.wikipedia.org/wikTree_%28data_structure%29#Terminologies_used_in_Trees