Add a constructor to Vector.h. Test class GraphMatrix, all tests passed. Dfs and Bfs remained to be done.

This commit is contained in:
Shine wOng
2019-06-03 21:40:02 +08:00
parent b638fbc71f
commit 3880e2125a
7 changed files with 233 additions and 27 deletions

View File

@@ -66,6 +66,12 @@ void test_constructor() {
assert(V5.getSize() == 2);
assert(V5.getCapacity() == 4);
Vector<int> V6(10, 0);
assert(V6.getSize() == 10);
assert(V6.getCapacity() == 20);
for (int ix = 0; ix != 10; ++ix)
assert(V6[ix] == 0);
cout << "test passed." << endl;
}