MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / bs

Function bs

contents/algorithm/code/lis_bs.cpp:5–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3int arr[1000001],ans[1000001]={0,};
4
5int bs(int low,int high,int key){
6 if(low > high) return low;
7 int mid = (low+high)/2;
8 if(key < ans[mid]) return bs(low,mid-1,key);
9 else if(key > ans[mid]) return bs(mid+1,high,key);
10 else return mid;
11}
12
13int main(){
14 int n,idx=1;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected