DIY: Time Needed to Inform All Employees
Understand how to model and solve the problem of spreading urgent news through a company's management hierarchy. Learn to implement an efficient function to calculate the total time required to inform all employees by simulating message propagation within a network tree structure.
We'll cover the following...
We'll cover the following...
Problem statement
A company has n employees, and each employee has a unique ID from 0 to n - 1. The ID of the head of the company is headID.
Each employee has one direct manager given in the manager array. In the manager array, manager[i] is the direct manager of the i-th employee, ...