Add tests for same SCC O(1) query
This commit is contained in:
@@ -17,7 +17,7 @@ public:
|
||||
Tarjan(Digraph<T> G) : G(G) {}
|
||||
|
||||
//
|
||||
std::vector<SCC<T>> run();
|
||||
std::vector<SCC<T>> findSCC();
|
||||
|
||||
//
|
||||
void strongConnect(const T& v);
|
||||
@@ -68,7 +68,7 @@ void Tarjan<T>::strongConnect(const T& v) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::vector<SCC<T>> Tarjan<T>::run() {
|
||||
std::vector<SCC<T>> Tarjan<T>::findSCC() {
|
||||
for (const auto& v : G.vertices) {
|
||||
if (p[v].index == -1) {
|
||||
strongConnect(v);
|
||||
|
||||
Reference in New Issue
Block a user