Who is our Boss? LCA for n-array Tree - Algorithms and Problem SolvingAlgorithms and Problem Solving
Posted on In a company which has CEO Bill and a hierarchy of employees. Employees can have a list of other employees reporting to them, which can themselves have reports, and so on. An employee with at least one report is called a manager. Please implement the closestCommonManager method to find the closest manager (i.e. farthest from the CEO) to two employees. You may assume that all employees eventually report up to the CEO. Assume the following class which you can't change – public static class Employee { private final int id; private final String name; private final ListRead full article from Who is our Boss? LCA for n-array Tree - Algorithms and Problem SolvingAlgorithms and Problem Solving
No comments:
Post a Comment