Update Topological-Sort.md

This commit is contained in:
Aakash Panchal 2020-02-02 15:59:45 +05:30 committed by GitHub
parent eb1c9f64af
commit 77593ab2f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,8 +96,8 @@ void Topological_sort(int no_vertices, vector<vector<int> > &graph)
vector<int> indegrees(no_vertices + 1);
for(int i = 1; i <= graph.size(); i++)
for(int j = 0; j < graph[j].size(); j++)
for(int i = 1; i < graph.size(); i++)
for(int j = 0; j < graph[i].size(); j++)
indegrees[graph[i][j]]++;