Learn
Practice
Newsletter
Resources
Resume
New
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Time Needed to Inform All Employees
Bookmark
Input
Example 1
Example 2: Chain
Example 3: Multiple levels
Custom
n
=
6
,
headID
=
2
,
manager
=
[2, 2, -1, 2, 2, 2]
,
informTime
=
[0, 0, 1, 0, 0, 0]
0
inform: 0
1
inform: 0
2
inform: 1
3
inform: 0
4
inform: 0
5
inform: 0
Call Stack:
(empty)
Memo:
(empty)
Legend:
Not visited
Visiting
Computed
Memoized
algo
master
.
io
Step:
Start DFS from head employee 2
0 / 35
Input
Example 1
Example 2: Chain
Example 3: Multiple levels
Custom
n
=
6
,
headID
=
2
,
manager
=
[2, 2, -1, 2, 2, 2]
,
informTime
=
[0, 0, 1, 0, 0, 0]
0 / 35
0
inform: 0
1
inform: 0
2
inform: 1
3
inform: 0
4
inform: 0
5
inform: 0
Call Stack:
(empty)
Memo:
(empty)
Legend:
Not visited
Visiting
Computed
Memoized
algo
master
.
io
Step:
Start DFS from head employee 2