Refactor: Replace std::map and std::set with unordered versions
This commit is contained in:
@@ -28,17 +28,17 @@ public:
|
||||
// Remove edge (u,v) and update A accordingly for fast checking query
|
||||
void remove(const T& u, const T& v) override;
|
||||
|
||||
std::map<T, SCC<T>> getSCCs() { return C; }
|
||||
std::unordered_map<T, SCC<T>> getSCCs() { return C; }
|
||||
private:
|
||||
// Array used to answer strong connectivity queries in O(1) time
|
||||
std::map<T, T> A;
|
||||
std::unordered_map<T, T> A;
|
||||
|
||||
// Connect each representative with its SCC
|
||||
std::map<T, SCC<T>> C;
|
||||
std::unordered_map<T, SCC<T>> C;
|
||||
|
||||
// Maintain in-out bfs trees
|
||||
std::map<T, BreadthFirstTree<T>> In;
|
||||
std::map<T, BreadthFirstTree<T>> Out;
|
||||
std::unordered_map<T, BreadthFirstTree<T>> In;
|
||||
std::unordered_map<T, BreadthFirstTree<T>> Out;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user