Repeat Part a of the previous exercise, but now assume that we are not equally likely to search for each value in the array. We could arrange the n items in the array such that the ones we are more likely to search for occur first. Suppose that we search for the first item one half of the time, the second item one quarter of the time, the third item one eighth of the time, and so on. We will search for the last two items 1/ 2n - 1 of the time. Revise the table in the previous exercise accordingly.

ENGR 121 B Lab Notes for 10/24/2016 Spencer Kociba ● scalarctneeds to have scalar.^vector ● vector(logical vector) ○ Will find every value for whom’s element equals 1 in the logical vector ● Looping repeats the action for every element in a vector ● Example of nested for loops ○ For m=1:3 ■ For n=-1:-1:-3 ● fprintf(‘m=%d, n=%d\n, m,n) ■ End ○ End ○ >> %Will give all combinations created by the for loop (9 in this one) ■ m=1, n=-1 ■ m=1, n=-2 ■ … ■ m=3, n=-3