path/height of tree like structure
0 Answers
path/height of tree like structure
| Flag | PURGE
Consider the following class definition:
class Node {
List<Node> node;
void addChild (Node testNode);
}
Assume you have a node object like above. This node object can contain a child node object. Assuming you are given one of these objects, write a function to determine the maximum path length from the root node to the most distant remote node.
Its not exactly tree as it doesnt have any left and right information but it has nodes on both sides.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.