C/C++ C++ Binary Search Help - Find #23

  • Thread starter Thread starter icanpartseas
  • Start date Start date
  • Tags Tags
    Binary Search
AI Thread Summary
The discussion centers around writing a C++ program that generates the first 100 odd numbers and implements a binary search to find the 23rd odd number. Participants emphasize the importance of understanding binary search algorithms and suggest researching the topic for better comprehension. They recommend using resources like Wikipedia and specific programming websites for guidance. It's advised to attempt a preliminary solution and seek help on dedicated forums for homework assistance if further issues arise. The focus is on encouraging self-study and practical application through coding and testing.
icanpartseas
Messages
1
Reaction score
0
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? I am ompletely lost
 
Technology news on Phys.org
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top