From d81bf6ec7d6a8c7c2c67f432e186492dcff81081 Mon Sep 17 00:00:00 2001 From: Luke Videckis Date: Wed, 23 Oct 2024 13:49:19 -0700 Subject: [PATCH] remove PQ comments --- content/graph/TopoSort.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/graph/TopoSort.h b/content/graph/TopoSort.h index f041bb447..89d4eba1f 100644 --- a/content/graph/TopoSort.h +++ b/content/graph/TopoSort.h @@ -12,12 +12,12 @@ #pragma once vi topoSort(const vector& gr) { - vi indeg(sz(gr)), q; // use priority_queue for lexic. largest ans. + vi indeg(sz(gr)), q; for (auto& li : gr) for (int x : li) indeg[x]++; rep(i,0,sz(gr)) if (indeg[i] == 0) q.push_back(i); int j = 0; while (j < sz(q)) { - int i = q[j++]; // top() for priority queue + int i = q[j++]; for (int x : gr[i]) if (--indeg[x] == 0) q.push_back(x); }