Source code - binary.cpp

Find C and C++ source code to help you learn to program. You can submit your own code, or you can simply browse and download the code of others.

Index :: Algorithms :: Searching / binary.cpp
resource information
Title binary.cpp
Category 10
Description binary search that returns a negative one if the number is not found This code does a bubble sort and then proforms the binary search
Contact David Thompson
Added 08-10-2002 at 01:30 p.m.
Last Updated 08-10-2002 at 01:32 p.m.
Current Rating 3.8
Rate Resource
Number of Reviews 20
Review this Resource
  • homework help science <a href="">statistics homework helper</a> essay corrector <a href=>illustration essay</a> college paper <a href="">college paper</a> college paper <a href=>college paper</a> online payday loans direct lenders <a href="">same day payday loans online</a> online payday loans instant approval <a href=>cash til payday loan</a> research writing <a href="">research essay</a> research writing <a href=>research papers</a> direct lender loans <a href="">installment loan</a> bad credit payday loans direct lenders <a href=>bad credit payday loans direct lenders</a> payday express <a href="">payday loans lenders</a> the best online payday loans <a href=>the best online payday loans</a> cash advance lenders <a href="">cash advance lenders</a> cash advance lenders <a href=>pay day lenders</a>
    posted at 09:09 p.m. on 01-19-2018
  • faxless payday loan <a href="">payday loan</a> guaranteed personal loans <a href=>payday loan</a>
    posted at 07:15 p.m. on 01-18-2018
  • write an essay for me <a href="">write an essay about your school</a> essays <a href=>essay for me</a>
    posted at 09:21 p.m. on 01-17-2018
  • discover loans <a href="">cash advance loans</a> cash advance loan <a href=>advance cash</a>
    posted at 06:47 p.m. on 01-13-2018
  • payday loan <a href="">advance cash payday loan</a> payday <a href=>payday</a>
    posted at 02:06 p.m. on 01-12-2018
  • car insurance <a href="">aaa auto insurance quote</a> compare auto insurance quotes <a href=>cheap car insurance</a>
    posted at 10:55 a.m. on 12-26-2017
  • webcam room <a href=>live cams</a> free sex chats <a href=>free webcam sex</a>
    posted at 02:16 p.m. on 11-01-2017
  • <a href=>write my essay</a>
    posted at 08:34 a.m. on 09-10-2017
  • wh0cd77828 <a href=>cheap sildenafil</a> <a href=>cialis coupon</a>
    posted at 03:02 p.m. on 06-01-2017
  • 1
    posted at 12:01 p.m. on 05-27-2017
  • tBafum <a href="">frdjctzpgkmf</a>, [url=]hmiixezzwpgv[/url], [link=]ockucgiyczef[/link],
    posted at 03:07 p.m. on 12-03-2016
  • 1
    posted at 08:03 p.m. on 11-24-2016
  • 1
    posted at 09:46 p.m. on 11-23-2016
  • 1
    posted at 02:32 p.m. on 11-05-2016
  • 1
    posted at 07:06 p.m. on 09-13-2016
  • SoZ1e2 <a href="">bocjvyfobhvw</a>, [url=]fqslsoqfpwvg[/url], [link=]fgrrjwjurmfx[/link],
    posted at 06:08 p.m. on 07-03-2016
  • dYHMxH <a href="">iszqfambucqc</a>, [url=]lbtqwsjbgywu[/url], [link=]zrsealqxhwxb[/link],
    posted at 03:48 p.m. on 06-05-2016
  • 1
    posted at 10:59 a.m. on 11-28-2014
  • 1
    posted at 11:25 a.m. on 06-15-2013
  • It is an ok source, it could have been written better. The code needs to be changed in the do loop so there are not any more errors or crashes. (ex: do { if(b > a[mid]) { low = mid + 1; mid = (high + low) / 2; } else if(b < a[mid]) { high = mid - 1; mid = (high + low) / 2; } else if(b == a[mid]) { return mid + 1; } }while(low < high); But otherwise is good.
    posted at 06:25 p.m. on 02-13-2006