| 23 | } |
| 24 | |
| 25 | int numOfMinutes(int n, int headID, vector<int>& manager, vector<int>& informTime) { |
| 26 | subo.resize(n, vector<int>()); |
| 27 | info_time.assign(informTime.begin(), informTime.end()); |
| 28 | |
| 29 | for (int i=0; i<n; i ++) |
| 30 | if (manager[i] != -1) |
| 31 | subo[manager[i]].push_back(i); |
| 32 | /* this is called `Adjacency list` */ |
| 33 | // dfs can use recursive, do not need stack |
| 34 | return dfs(headID); |
| 35 | } |
| 36 | }; |
| 37 | |
| 38 | int main() { |
nothing calls this directly
no outgoing calls
no test coverage detected