Question: (1) Write the pseudocode for searching a key K in an array A(n), using a sentinel. Show the best, worst and average cases. (2) Write
(1) Write the pseudocode for searching a key K in an array A(n), using a sentinel. Show the best, worst and average cases.
(2) Write a recursive pseudocode to calculate n!, as fac(n). Write the recurrence for the running time in terms of the number of multiplications and solve the recursion.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
