Skip to content

Commit 52d3fdd

Browse files
committed
update ch1
1 parent 342109b commit 52d3fdd

40 files changed

Lines changed: 409 additions & 352 deletions

File tree

ch1/20_ResizingArrayQueue/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
using namespace std;
66

7-
7+
/**
8+
* Unit tests the {@code ResizingArrayQueue} data type.
9+
*
10+
* @param args the command-line arguments
11+
*/
812
int main() {
9-
ifstream file("/home/ace/AceDev/C++/algorithm/ch1/data/tobe.txt");
13+
ifstream file("./data/tobe.txt");
1014
ResizingArrayQueue<string> queue;
1115
string tmp;
1216
while (file >> tmp) {

ch1/21_LinkedQueue/main.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
#include <fstream>
33
#include "../head/LinkedQueue.h"
44

5-
#include <memory>
65

76
using namespace std;
87

9-
8+
/**
9+
* Unit tests the {@code LinkedQueue} data type.
10+
*
11+
* @param args the command-line arguments
12+
*/
1013
int main() {
11-
// unique_ptr<int> p(nullptr);
12-
// cout << (p == nullptr) << endl;
13-
ifstream file("/home/ace/AceDev/C++/algorithm/ch1/data/tobe.txt");
14+
ifstream file("./data/tobe.txt");
1415
LinkedQueue<string> queue;
1516
string tmp;
1617
while (file >> tmp) {

ch1/22_Queue/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
using namespace std;
66

7-
7+
/**
8+
* Unit tests the {@code Queue} data type.
9+
*
10+
* @param args the command-line arguments
11+
*/
812
int main() {
9-
ifstream file("/home/ace/AceDev/C++/algorithm/ch1/data/tobe.txt");
13+
ifstream file("./data/tobe.txt");
1014
Queue<string> queue;
1115
string tmp;
1216
while (file >> tmp) {

ch1/23_ResizingArrayBag/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
using namespace std;
66

7-
7+
/**
8+
* Unit tests the {@code ResizingArrayBag} data type.
9+
*
10+
* @param args the command-line arguments
11+
*/
812
int main() {
9-
ifstream file("/home/ace/AceDev/C++/algorithm/ch1/data/tobe.txt");
13+
ifstream file("./data/tobe.txt");
1014
ResizingArrayBag<string> bag;
1115
bag.add("Hello");
1216
bag.add("World");

ch1/24_LinkedBag/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
using namespace std;
66

7-
7+
/**
8+
* Unit tests the {@code LinkedBag} data type.
9+
*
10+
* @param args the command-line arguments
11+
*/
812
int main() {
9-
ifstream file("/home/ace/AceDev/C++/algorithm/ch1/data/tobe.txt");
13+
ifstream file("./data/tobe.txt");
1014
LinkedBag<string> bag;
1115
string tmp;
1216
while (file >> tmp) {

ch1/25_Bag/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
using namespace std;
66

7-
7+
/**
8+
* Unit tests the {@code Bag} data type.
9+
*
10+
* @param args the command-line arguments
11+
*/
812
int main() {
9-
ifstream file("/home/ace/AceDev/C++/algorithm/ch1/data/tobe.txt");
13+
ifstream file("./data/tobe.txt");
1014
Bag<string> bag;
1115
string tmp;
1216
while (file >> tmp) {

ch1/26_Stopwatch/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
using namespace std;
66

7-
7+
/**
8+
* Unit tests the {@code Bag} data type.
9+
*
10+
* @param args the command-line arguments
11+
*/
812
int main() {
913
int n = 10000;
1014
// sum of square roots of integers from 1 to n using Math.sqrt(x).

ch1/28_LinearRegression/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
using namespace std;
55

6-
6+
/**
7+
* simple test
8+
* @return
9+
*/
710
int main() {
811
vector<double> a{1.0, 2.0, 3.0, 4.1}, b{1.01, 2.01, 2.99, 4.0};
912
LinearRegression lr(a, b);

ch1/29_ThreeSum/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using namespace std;
1313
* @param args the command-line arguments
1414
*/
1515
int main() {
16-
ifstream file("/home/ace/AceDev/C++/algorithm/ch1/data/2Kints.txt");
16+
ifstream file("./data/2Kints.txt");
1717
vector<int> vec;
1818
int tmp;
1919
while (file >> tmp)

ch1/30_ThreeSumFast/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using namespace std;
1313
* @param args the command-line arguments
1414
*/
1515
int main() {
16-
ifstream file("/home/ace/AceDev/C++/algorithm/ch1/data/1Kints.txt");
16+
ifstream file("./data/1Kints.txt");
1717
vector<int> vec;
1818
int tmp;
1919
while (file >> tmp)

0 commit comments

Comments
 (0)