Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

binary search program in c++??

Computer Science
I got my questions answered at in under 10 minutes. Go to now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly


Get your free account and access expert answers to this and thousands of other questions

do you need the whole process??
Either use this short equation (arra[mid]!=num) //NOTE THE EXTRA flush AT END. //FYI endl = flush + "\n" (so that can also be used) cout<<"\nnot found" << flush ; else if (arra[mid]==num) cout<<"location is\t"<
Or if your looking for advanced use/// #include #include #define siz 10 void main() { int arra[siz]={0}; int mid,beg=1,end=siz,loca=0,num; clrscr(); cout<<"Please Enter The Elements Of Array\n"; for(loca=0;loca>arra[loca]; } cout<<"Please enter the required number"; cin>>num; mid=(loca)/2; while(beg

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Try this too if you want #include #include void main() { int a[20],n,i,top,bottom,mid,f,s; clrscr(); cout<<"Enter the value of n:"; cin>>n; cout<<"\nEnter the values:\n"; for(i=0;i>a[i]; } cout<<"Enter the element to be searched:"; cin>>s; top=0; bottom=n-1; f=0; while(top<=bottom && f==0) { mid=(top+bottom)/2; if(s>a[mid]) { top=mid+1; } else if(s

Not the answer you are looking for?

Search for more explanations.

Ask your own question