- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.cpp
More file actions
Latest commit
11 lines (9 loc) · 333 Bytes
/
Copy pathtest.cpp
File metadata and controls
11 lines (9 loc) · 333 Bytes
1
2
3
4
5
6
7
8
9
10
11
#include<iostream>
#include"binarysearch.h"
usingnamespacestd;
intmain() {
int A[20] = {0,1,1,1,1,2,2,2,2,4,4,4,4,5,6,6,6,10, 11, 11};
cout << "search for 5: " << binary_search(A, 0, 20, 5) << endl;;
cout << "lower of 6: " << lower_bound(A, 0, 20, 6) << endl;
cout << "upper of 6: " << upper_bound(A, 0, 20, 6) << endl;
}