This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tarjan | |
import scala.collection.mutable | |
// See python version: https://github.com/bwesterb/py-tarjan | |
/** | |
* Tarjan's algorithm is an algorithm in graph theory for finding the strongly connected components of a directed graph. It runs in linear time, | |
* matching the time bound for alternative methods including Kosaraju's algorithm and the path-based strong component algorithm. | |
*/ | |
class TarjanRecursive { |