Question Bank IA1
Question Bank IA1
1. Define Algorithm? Explain the notion of an algorithm and list out its important
properties.
2. Discuss various algorithms to calculate GCD of 2 numbers.
3. With a pseudocode, Explain Sieve of Eratosthenes algorithm. Trace the same for
n=50.
4. With an example, discuss how to find the time complexity of an algorithm.
5. Find the time complexity of the following codes.
i)
ii)
S←S+i∗i
for i ← 1 to n do
return S
a. What does this algorithm compute?
b. What is its basic operation?
c. How many times is the basic operation executed?
20. Consider the following recursive algorithm.
Algorithm Q(n)
//Input: A positive integer n