Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.
C Coding question on running time program
Public static intbinarySearch(int x,int a[]){
int low=0; 0(1)
int high=a.length-1; 0(1)
int mid; 0(1)
while(low<=high){
mid=(low+high)/2
if(a[mid]
else if(a[mid]>x)
high=mid-1;
else
return mid;
}
return -1;
}
---------------------
n=0 0(1)
sum=0; 0(1)
cin>>x;
while(x!=99)
{
n++; 0(1)
sum+=x; 0( n/x)
cin>>x;
}
mean - sum/n;
what is the running time?
Please help me understand it. The websites are not that helpful to me. Please. Please if you're not that busy can you please answer it with explanations?:) :) :) THANK YOU!!
Profile Answers by Joanne Tan Questions by Joanne Tan
Questions by Joanne Tan