Quiz-1
This Question is based on the following topic and there are no negative marks, the are total 10 Question for 5 marks
- Analyzing Algorithms
- Theoretical Foundation
- Algorithms and its Specification
- Random Access Machine Model
- Counting Primitive Operations
- The notion of best case, average case and worst case
- Characterizing Run Time
- Use of asymptotic notation
- Big-Oh Notation, Little-Oh, Omega and Theta Notations
- Analyzing Recursive Algorithms
- Recurrence relations
- Master's Theorem
The concept of order (Big O) is important because
[hint: This is a multi answer question]
What is the time complexity of the following code:
int i, j, k = 0;
for (i = n / 2; i<= n; i++) {
for (j = 2; j <= n; j = j * 2) {
k = k + n / 2;
}
}
What does it mean when we say that an algorithm X is asymptotically more efficient than Y?
For the following recurrences T(n) =2T(n/4) +n0.51, give an expression for the runtime T(n) if the recurrence can be solved with the master theorem.
[Hint: you can use T(n) =aT(n/b)+f(n) master theorem to solve the problem]
For the following recurrences T(n) = 3T(n/4) + O(logn) give an expression for the runtime.
Comments