Question: IN C Programming implement a binary search function that returns an index of the employee data with the value that you are searching for otherwise

IN C Programming

implement a binary search function that returns an index of the employee data with the value that you are searching for otherwise return -1 if the employee doesn't exist.

implement a exhaustive search function that returns an index of the employee data with the value that you are searching for otherwise return -1 if the employee doesn't exist

read from a dataset of 10 employees containing first, last name age and salary sorted by first name in ascending order and create an array of employee structure.

search the first name Sam using binary search and record the execution time for the function.Print out corresponding employees record and time it took on console

Now search Sam using exhaustive search and record the execution time for function. Print out corresponding employees record and time it took on console

search the first name Yuyan using binary search and record the execution time for the function.Print out corresponding employees record and time it took on console

Now search Yuyan using exhaustive search and record the execution time for function. Print out corresponding employees record and time it took on console

Use printf to explain the time difference between binary and exhaustive seach on the console for the 2 different scenarios.

dataset is below

Aaron,Hunt,36,663

Allie,Allen,49,2769 Allie,Burns,42,3307

Erik,Reid,36,9909 Erik,Wood,43,999

Jason,Stokes,28,7607 Jason,Jefferson,37,8621

Matthew,Maldonado,21,409

Peter,Richards,48,1590

Tyler,Page,58,5597

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!