Question: ?Create an algorithm for the following and give its running time. Let f(s) be a function from a finite set S into itself. Define for
?Create an algorithm for the following and give its running time.

Let f(s) be a function from a finite set S into itself. Define for all s epsilon S, f^(0)(s) = s and f^(n)(s) = f(f^(n - 1)(s)) for n>0. Give an efficient algorithm to identify for each x the smallest n and k such that f^(n) (x) = f^(n + k) (X) Analyse the running time of your algorithm as a function of n and k. How much space does your algorithm use as a function of n and k
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
