Question: Question 1: Suppose an algorithm has a time complexity which can be written as: T(n)nT(n-1)n Write any pseudo code of a method having this complexity.



Question 1: Suppose an algorithm has a time complexity which can be written as: T(n)nT(n-1)n Write any pseudo code of a method having this complexity. The method can be nonsense. Question 2: Below are the four time complexities of different algorithms. Alrorithm 1.7(n) = n2 Alrorithm 2.7(n) -nlgn Alrorithm 3.T(n)gn Alrorithm4.T(n) = n1.6 Which algorithm is the best for large size of n, plot the complexity in graph to support your result. Question 3: Below is an algorithm of determining a Prime number. boolean isPrime (int n) ( for (int i-2; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
