subject

In this exercise you will explore the performance difference between sequential search and binary search. To do so write a program that performs the following tasks: Prompt the user for a file containing 100,000 unsorted integers

Read those integers into an array

Prompt the user for a search item

Search for that item (using sequential search) and report the number of comparisons required.

Sort the array. Note that this will take about a minute.

Search for that item again (using binary search) and report the number of comparisons required.

You will need to modify both of the search functions to report the number of comparisons that were made during the search.

Use your program and the file of 100,000 integers provided here to answer the six questions in the quiz.

Question 1
Question text
Was search item 20000 found?

Select one:
True
False

Question 2
How many comparisons did sequential search make while searching the list for the value 20000?



Question 3
How many comparisons did binary search report in the search for 20000?



Question 4
Was the value 45000 found in this list?

Select one:
True
False

Question 5
How many comparisons were made by sequential search while searching for 45000?



Question 6
How many comparisons were made by binary search while searching for 45000?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:40
In a response of approximately 50 words, explain why it would be essential for the successful a/v technician to participate in additional coursework, presentations and seminars offered by equipment manufacturers as well as annual conferences attended by colleagues in the industry.
Answers: 1
question
Computers and Technology, 24.06.2019 12:30
Do you think media is stereotype ? and why?
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
This assignment continues work on the online booking facility introduced at the end of chapter- 10. the work will be continued in the assignments for chapters 14 and 15 (a) assume that you will produce your online booking facility using an agile approach. i. suggest the kind of user research you would like to conduct for your product before iteration cycles begin. ii prioritize the requirements for your product according to business value, i.e which requirements are likely to provide the greatest business benefit, and sketch out the ux design work you would expect to undertake during the first four iteration cycles, i.e. cycle 0, and cycles 1 to 3. (b) using one of the mockup tools introduced above, generate a mockup of your product's landing page, as developed in the assignment for chapter-11 (c) using one of the patterns websites listed previously, identify suitable interaction patterns for elements of your product, and develop a software-based prototype that incorporates all the feedback and the results of the user experience mapping achieved at the end of chapter-11. if you do not have experience in using any of these, create a few html web pages to represent the basic structure of your website
Answers: 2
question
Computers and Technology, 25.06.2019 10:30
Tools used in a particular career depend on the tasks performed. true or false
Answers: 1
You know the right answer?
In this exercise you will explore the performance difference between sequential search and binary se...
Questions
question
History, 21.03.2020 18:37
question
History, 21.03.2020 18:38