Refactor: Rename adjMatrix to adjList
This commit is contained in:
@@ -47,7 +47,7 @@ private:
|
||||
template<typename T>
|
||||
void Italiano<T>::init() {
|
||||
for (const auto& u : this->G.vertices()) {
|
||||
for (const auto& v : this->G.adjMatrix[u]) {
|
||||
for (const auto& v : this->G.adjList[u]) {
|
||||
E[v].inc.insert(u);
|
||||
E[u].out.insert(v);
|
||||
TC[u][v] = false;
|
||||
@@ -66,7 +66,7 @@ bool Italiano<T>::query(const T& u, const T& v) {
|
||||
|
||||
template<typename T>
|
||||
void Italiano<T>::remove(const T& u, const T& v) {
|
||||
if (!this->G.adjMatrix[u].contains(v)) return;
|
||||
if (!this->G.adjList[u].contains(v)) return;
|
||||
|
||||
std::map<T, std::stack<T>> H;
|
||||
for (const auto& w : this->G.vertices()) {
|
||||
@@ -78,7 +78,7 @@ void Italiano<T>::remove(const T& u, const T& v) {
|
||||
for (const auto& c : E[v].out)
|
||||
H[w].push(c);
|
||||
}
|
||||
RT[w].adjMatrix[u].erase(v);
|
||||
RT[w].adjList[u].erase(v);
|
||||
}
|
||||
}
|
||||
E[u].out.erase(v);
|
||||
@@ -97,7 +97,7 @@ void Italiano<T>::repairTrees(std::map<T, std::stack<T>>& H) {
|
||||
|
||||
for (const auto& i : E[h].inc) {
|
||||
if (RT[z].contains(z, i)) {
|
||||
RT[z].adjMatrix[i].insert(h);
|
||||
RT[z].adjList[i].insert(h);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user