-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestMGalgo.cpp
More file actions
39 lines (30 loc) · 951 Bytes
/
testMGalgo.cpp
File metadata and controls
39 lines (30 loc) · 951 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
38
39
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "MGalgo.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
vector<int> sorted_list;
sorted_list.push_back(1);
sorted_list.push_back(4);
sorted_list.push_back(8);
sorted_list.push_back(12);
sorted_list.push_back(15);
sorted_list.push_back(22);
sorted_list.push_back(25);
sorted_list.push_back(30);
std::cout << mgtl::binary_search(20, sorted_list) << ' ';
std::cout << mgtl::binary_search(0, sorted_list) << ' ';
std::cout << mgtl::binary_search(40, sorted_list) << ' ';
std::cout << mgtl::binary_search(8, sorted_list) << ' ';
std::cout << mgtl::binary_search(3, sorted_list) << std::endl;
vector<int> incident_3;
incident_3.push_back(10);
incident_3.push_back(20);
std::cout << mgtl::binary_search(5, incident_3) << std::endl;
return EXIT_SUCCESS;
};