Question: Objectives: In this lab, the following topic will be covered: 1. Searching 2. Sorting Task Write a program that creates an array of numbers from

Objectives: In this lab, the following topic will be covered: 1. Searching 2. Sorting Task Write a program that creates an array of numbers from 1 to 100,000,000 in ascending order. Display the execution time of invoking the linear search method and the binary search method. Display the execution time of invoking both searches for the following numbers: 1; 25,000,000; 50,000,000; 75,000,000; 100,000,000. You can use the following code template to obtain the execution time: long startTime = System.nanoTime(); /**perform the task*/ long endTime = System.nanoTime(); long execution Time = endTime - startTime
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
