What code works here
Write C functions with for, while, if, arrays, return and recursion. Helper functions are fine. The input size is the parameter called n, or the length of the array. Arrays are sorted in reverse for the worst case and in order for the best case, and a search key such as x or key is missing in the worst case.
Prof. Bolts runs your function for n = 1, 2, 4 … up to 1024, counts every line, and finds the exact formula. Each part of a loop header (i = 0, i < n, i++) counts as one step.