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, 21.06.2019 21:30
Apower user needs you to install a second type of operating system on his computer to increase efficiency while running some specialized software programs. which installation technique should you use?
Answers: 3
question
Computers and Technology, 22.06.2019 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
question
Computers and Technology, 23.06.2019 09:50
Allison and her group have completed the data entry for their spreadsheet project. they are in the process of formatting the data to make it easier to read and understand. the title is located in cell a5. the group has decided to merge cells a3: a7 to attempt to center the title over the data. after the merge, allison points out that it is not centered and looks bad. where would the title appear if allison unmerged the cells in an attempt to fix the title problem?
Answers: 2
You know the right answer?
In this exercise you will explore the performance difference between sequential search and binary se...
Questions
question
Mathematics, 24.06.2019 00:30
Questions on the website: 13722361