Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Binary search help

  1. Feb 12, 2009 #1
    I have to write a C++ binary search code where it generates the first 100 odd numbers and the search is used to the find the # 23 any help? im ompletely lost
     
  2. jcsd
  3. Feb 13, 2009 #2
    If you are completely lost, you are either very modest, didn't go to class, or have no time to do your homework.
    You would do well if you read up some background information and post a tentative solution at the appropriate forum for homework help:
    https://www.physicsforums.com/forumdisplay.php?f=158

    You could either Google "binary search", or try the following links:
    http://en.wikipedia.org/wiki/Binary_search
    http://www.fredosaurus.com/notes-cpp/algorithms/searching/binarysearch.html

    After that, compile the sample program and do some tests. If you have questions about the algorithms, you can post here. For problems related to coding, you can post at the homework help site.

    Good luck.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Binary search help
  1. Binary Search Tree C++ (Replies: 1)

  2. Binary Search Error (Replies: 0)

Loading...