Question: When would you use the Binary Search method over the Sequential Search method? Discuss each of the following problem in terms of searching: John has
When would you use the Binary Search method over the Sequential Search method?
Discuss each of the following problem in terms of searching:
John has a weather station in his house. He has been keeping track of the fastest wind speed for each day for two weeks. He would like to know the average wind speed over the two weeks, the days on which the highest wind speed and the lowest wind speed were recorded, and the difference between the highest wind speed recorded and each days average wind speed.
The student names and the grades for four tests for Mr. Smiths class have been placed in parallel arrays. Mr. Smith would like to have one students name and test scores printed. Develop a solution that will enter the students name, search for the name in the same array, and then print the name and test scores. Use the sequential-search method.
Modify the solution in problem 3 to use a binary search instead of a sequential search.
The human resources manager of XYZ Corporation would like to analyze the following characteristics of company employees:
the wages of women compared with those of men
the total number of employees in each of the 12 departments
the number of women and men in each of the 12 departments
the average age of the women and men in each department
When would you use the Binary Search method over the Sequential Search method?
Discuss each of the following problem in terms of searching:
John has a weather station in his house. He has been keeping track of the fastest wind speed for each day for two weeks. He would like to know the average wind speed over the two weeks, the days on which the highest wind speed and the lowest wind speed were recorded, and the difference between the highest wind speed recorded and each days average wind speed.
The student names and the grades for four tests for Mr. Smiths class have been placed in parallel arrays. Mr. Smith would like to have one students name and test scores printed. Develop a solution that will enter the students name, search for the name in the same array, and then print the name and test scores. Use the sequential-search method.
Modify the solution in problem 3 to use a binary search instead of a sequential search.
The human resources manager of XYZ Corporation would like to analyze the following characteristics of company employees:
the wages of women compared with those of men
the total number of employees in each of the 12 departments
the number of women and men in each of the 12 departments
the average age of the women and men in each department
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
