Topological Sort
j+d, j+d v+e, v+e function topologicalSort(jobs, deps) { const answer = (); // create adj list for each job const adj = {}; for (let i = 0; i < jobs.length; i++) { const job = jobs(i); if (adj(job) === undefined) adj(job) = (); } // form a adj list // count edges directing there … Read more