-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.cpp
More file actions
31 lines (24 loc) · 801 Bytes
/
example.cpp
File metadata and controls
31 lines (24 loc) · 801 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
//
// Created by Rogério Aristida Guimarães Junior on 3/28/21.
//
#include <iostream>
#include "big_int.hpp"
#include "fusiontree.hpp"
int main() {
vector<big_int> small_squares;
for (int i = 1; i <= 5; i++) {
small_squares.push_back(i * i);
}
environment *env = new environment;
fusiontree my_fusiontree(small_squares, env);
int idx1 = my_fusiontree.find_predecessor(3);
int idx2 = my_fusiontree.find_predecessor(9);
int idx3 = my_fusiontree.find_predecessor(0);
cout << "Fusion Tree size:" << endl;
cout << my_fusiontree.size() << endl;
cout << "Queried positions:" << endl;
cout << idx1 << " " << idx2 << " " << idx3 << endl;
cout << "Queried elements:" << endl;
cout << (int)my_fusiontree.pos(idx1) << " " << (int)my_fusiontree.pos(idx2)
<< endl;
}