Lecture 13 Pre-Class

  1. (4 pts.) Take a look at this code which implements different search algorithms in Python. Explain how each search algorithm works (if you use any outside resources for this, please cite them).
  2. (6 pts.) Determine the time needed to search a list of size \(10^1\), \(10^2\), \(10^3\), \(10^4\), \(10^5\), \(10^6\), \(10^7\), \(10^8\) for a given element using each of the search methods (use the code from problem 1). Which algorithm seems to be the most efficient as the size of the list grows? Hint: in Jupyter you can time the execution of a cell by adding %%time as the first line in the cell.