The JS code for topological sort does not work if the input is the following
vertices = 3, edges = [[1,2],[2,3],[3,1]]
It throws a TypeError on line 18
graph[parent].push(child); // put the child into it’s parent’s list
TypeError: Cannot read property 'push' of undefined at /usercode/index.js:18:19
Please look into this and fix this ASAP
Type your question above this line.