Skip to content

Instantly share code, notes, and snippets.

@PavelPenkov
Created October 23, 2013 10:02
Show Gist options
  • Save PavelPenkov/7115860 to your computer and use it in GitHub Desktop.
Save PavelPenkov/7115860 to your computer and use it in GitHub Desktop.
def reversed = adj.zipWithIndex.foldLeft(Digraph(n)){(g, p) => p._1.foldLeft(g){(fg, tail) => fg.addEdge(tail, p._2)}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment