LC: 582. Kill Process - spiralgo/algorithms GitHub Wiki

582. Kill Process:

The Essence:

  • The parent-child relationship between processes can be thought of as a directed graph.
  • The problem is then to return all nodes that can be traversed (searched/accessed) from the given process kill.
  • This traversal needs to be done efficiently.

Details:

The directed graph can be created using many data structures such as maps, lists and arrays. The traversal can be done using DFS or BFS.