Topological sort: Difference between revisions
→{{header|C++}}: Appended std scope resolution to size_t (necessary?)
(→{{header|C++}}: moved std::vector inclusion directive to proper place) |
(→{{header|C++}}: Appended std scope resolution to size_t (necessary?)) |
||
Line 651:
struct relations
{
std::size_t
dependencies;
std::set<Goal>
Line 691:
sorted.push_back(key);
}
for(std::size_t index = 0; index < sorted.size(); ++index)
for(auto const& key : map[sorted[index]].dependents)
if(--map[key].dependencies == 0)
|