Skip to content

Instantly share code, notes, and snippets.

View gengyu89's full-sized avatar

__init__.py gengyu89

View GitHub Profile
@gengyu89
gengyu89 / TarjanRecursive.scala
Created January 31, 2021 21:19 — forked from fbaierl/TarjanRecursive.scala
Tarjan's algorithm for Scala
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 {