This commit is contained in:
2024-12-05 15:46:08 +08:00
parent 08f6f4b0f4
commit 4ae4cf8554
26 changed files with 1385 additions and 1381 deletions
+35 -35
View File
@@ -1,35 +1,35 @@
//
// Created by 31416 on 24-12-5.
//
#ifndef MATRIXGRAPH_H
#define MATRIXGRAPH_H
#include<vector>
using namespace std;
template<typename T>
class MatrixGraph {
private:
vector<T> data;
vector<vector<bool> > matrix;
int nodeCount;
public:
MatrixGraph() {
matrix.clear();
data.clear();
nodeCount = 0;
}
void insert(T value) {
data.push_back(value);
nodeCount++;
matrix.push_back(vector<bool>(nodeCount, false));
for(int i = 0; i < nodeCount-1; ++i) {
matrix[i].push_back(false);
}
}
};
#endif //MATRIXGRAPH_H
//
// Created by 31416 on 24-12-5.
//
#ifndef MATRIXGRAPH_H
#define MATRIXGRAPH_H
#include<vector>
using namespace std;
template<typename T>
class MatrixGraph {
private:
vector<T> data;
vector<vector<bool> > matrix;
int nodeCount;
public:
MatrixGraph() {
matrix.clear();
data.clear();
nodeCount = 0;
}
void insert(T value) {
data.push_back(value);
nodeCount++;
matrix.push_back(vector<bool>(nodeCount, false));
for(int i = 0; i < nodeCount-1; ++i) {
matrix[i].push_back(false);
}
}
};
#endif //MATRIXGRAPH_H