-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSource.cpp
More file actions
33 lines (26 loc) · 692 Bytes
/
Source.cpp
File metadata and controls
33 lines (26 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <fstream>
#include <string>
//#include "libs\red_black_tree.h"
#include "libs\red_black_tree_file.h"
int main(int argc, char * argv[]) {
file::red_black_tree file_t(argv[1]);
std::ifstream myFile(argv[2]);
std::string line;
if (myFile.is_open())
while (getline(myFile, line))
file_t.add(std::stoi(line));
else
std::cout << "unable to open input file\n";
myFile.close();
//file_t.print();
myFile.open(argv[3]);
if (myFile.is_open())
while (getline(myFile, line)) {
std::cout << "elemento de busca: " << line << ' ';
file_t.get_element(std::stoi(line));
}
else
std::cout << "unable to open search file\n";
//system("pause");
}