Topological sorting?

Jimmy (xiaoke) Shen
1 min readMar 3, 2020

--

Here is the question

You have threads which have list of dependencies. A thread can only be executed only if all it's list of dependencies are executed. What will be the max size of thread pool required to satisfy all the thread dependencies?

How can we solve it? By using topological sorting?

Is it similar to LC207?

We will see.

--

--

No responses yet