Lab:

Searching algorithms


Prelab Task:

1.  Fix yourLab_01 (if you did something wrong.) Make sure your  deSelsort function work correctly (since it will be used in this lab.)

2.  Please review the following searching algorithms you have learned in COSC 120 & 220. Make sure you understand the algorithms, their implementation, and worst-case time complexity of each algorithm.  

 

Lab Task:

In this lab, we will experiment the worst-case time complexity of binary search by finding the maximum number of comparisons needed for searching values in an array.

·      For a random list of integers, what is the maximum number of comparisons required to find a target value by binary search? Please elaborate your answer.

                     sumFailCom/( RANDOMVALUES-successTotal)

                     sumSucCom/successTotal

 

What to Turn In