← 返回 microsoft 的题目列表Employee Management Structure in Tree
类型:online_judge
Design a data structure to represent a company's hierarchical employee management system, where cycles or invalid input might exist. Implement the following functions: 1. add_employee(manager, employee) to add an employee under a manager; 2. validate_structure() to check if the management structure is valid and acyclic.
Example
Input
A B
B C