Submit into the google drive here when you are finished!
// new HW // create a recursive function binSearch(n, low, high) that looks for the number n in a sorted list // This is called the binary search algorithm // binSearch(5) = true // binSearch(1) = false // 0 2 3 4 5 6 7 8 // see if n is equal to len(list) / 2 // if it is greater than len(list) / 2: traverse the upper half // else traverse the lower half // base case // operation // recursive function // output: true or false hint: use low and high as variables to determine which part of the array to look around
Also watch these two videos:
Dynamic Programming: https://www.youtube.com/watch?v=oNoILrFOx2k
Greedy Algorithms: https://www.youtube.com/watch?v=lfQvPHGtu6Q
You can reach out to me at ddjapri@ayclogic.com if you have any questions!
You can find class notes here.