-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cc
More file actions
38 lines (30 loc) · 728 Bytes
/
test.cc
File metadata and controls
38 lines (30 loc) · 728 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
34
35
36
37
#include "kdtree.hpp"
#include <iostream>
typedef std::tuple<int,char> Key;
int main() {
#ifdef USE_STANDARD
ads::standard_kdtree<Key> tree;
#elif USE_QUADTREE
ads::quadtree<Key> tree;
#else
ads::relaxed_kdtree<Key> tree;
#endif
for( int i = 0; i < 10; i++ ) {
tree.insert( std::make_tuple(i,'a'+i) );
}
for( int i = 0; i < 10; i++ ) {
bool found = tree.find( std::make_tuple(i,'a'+i) );
if( found )
std::cout << "Found! ";
else
std::cout << "Not found... ";
std::cout << i << ", " << (char)('a'+i) << std::endl;
}
bool found = tree.find( std::make_tuple(3,'a') );
if( found )
std::cout << "Found! ";
else
std::cout << "Not found... ";
std::cout << "3,a" << std::endl;
return 0;
}