MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / check

Function check

CPP/searching/binary_search2.cpp:8–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#define mod 1000000007
7#define endl '\n'
8int check(int arr[],int n,int key){
9 int s,e;
10 s=0;
11 e=n-1;
12 int ans=0;
13 while(s>=e){
14 int mid=s+(s+e)/2;
15 if(arr[mid]==key)
16 ans=1;
17 else if(key>arr[mid])
18 s=mid+1;
19 else
20 e=mid-1;
21 }
22 return ans;
23}
24string isSubset(int arr1[],int arr2[],int n, int m){
25 sort(arr1,arr1+n);
26 for (int i = 0; i < m; i++) {

Callers 3

isSubsetFunction · 0.70
checkMethod · 0.50
isBalancedMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected