@@ -0,0 +1,728 @@
+/* Computing strongly connected components of a directed graph */%0A/* There are more than 800,000 vertices and 5,000,000 edges in the graph */%0A/* Memery management need to be very careful */%0A/* Adajcency list is used to represent the graph */%0A/* Kosaraju%E2%80%99s Two-Pass algorithm is used to find SCCs */%0A/* Stack is used to implement DFS */%0A%0A'use strict';%0A%0Aconst %7B createReadStream %7D = require('fs');%0Aconst %7B createInterface %7D = require('readline');%0A%0Aconst graph = %5B%5D;%0Aconst rl = createInterface(%7B%0A%09input: createReadStream('directed-graph.txt')%0A%7D);%0A%0Arl.on('line', (line) =%3E %7B%0A%09const list = line.split(' ');%0A%09// Remove the last entry which is a space%0A%09list.pop();%0A%09graph.push(list);%0A%7D);%0A%0Arl.on('close', () =%3E %7B%0A%09console.log(graph)%0A%7D);

update scc