Binary search help

  • #1

Main Question or Discussion Point

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
 

Answers and Replies

  • #2
365
0
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.
 

Related Threads on Binary search help

  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
1
Views
6K
Replies
7
Views
74K
  • Last Post
Replies
12
Views
631
Replies
2
Views
21K
Replies
8
Views
842
Replies
5
Views
845
Replies
3
Views
4K
Replies
46
Views
7K
Top