Design and Analysis of Algorithms
106502Module 1: Introduction
Q1a. Which of the following best describes space complexity? (i) Time taken by the algorithm (ii) Memory required to run an algorithm (iii) Number of recursive calls (iv) Number of loops used20242m
Module 1: Introduction
View this question on its own page →Which of the following best describes space complexity?
(i) Time taken by the algorithm
(ii) Memory required to run an algorithm
(iii) Number of recursive calls
(iv) Number of loops usedQ1a. Which property of an algorithm ensures that every step is clear and has exactly one meaning? (i) Finiteness (ii) Effectiveness (iii) Definiteness (iv) Generality20252m
Module 1: Introduction
View this question on its own page →Which property of an algorithm ensures that every step is clear and has exactly one meaning?
(i) Finiteness
(ii) Effectiveness
(iii) Definiteness
(iv) GeneralityQ1a. Which of the following notations is used to represent the worst-case time complexity of an algorithm? (i) O-notation (ii) \Omega-notation (iii) \Theta-notation (iv) \delta-notation20232m
Module 1: Introduction
View this question on its own page →Which of the following notations is used to represent the worst-case time complexity of an algorithm?
(i) O-notation
(ii) -notation
(iii) -notation
(iv) -notationQ1b. An algorithm is made up of two independent time complexities f(n) and g(n). Then the complexities of the algorithm is in the order of (i) f(n) \times g(n) (ii) \max \{ f(n), g(n) \} (iii) \min \{ f(n), g(n) \} (iv) f(n) + g(n)20222m
Module 1: Introduction
View this question on its own page →An algorithm is made up of two independent time complexities and . Then the complexities of the algorithm is in the order of
(i)
(ii)
(iii)
(iv)Q1b. If an algorithm has time complexity T(n) = 5n^2 + 3n + 7, its asymptotic upper bound is: (i) O(n) (ii) O(n^2) (iii) O(n \log n) (iv) O(n^3)20242m
Module 1: Introduction
View this question on its own page →If an algorithm has time complexity , its asymptotic upper bound is:
(i)
(ii)
(iii)
(iv)Q1b. In Asymptotic notation, Big- \Omega (Omega) is used to represent (i) The upper bound (Worst-case) (ii) The lower bound (Best-case) (iii) The tight bound (Average-case) (iv) None of the above20252m
Module 1: Introduction
View this question on its own page →In Asymptotic notation, Big- (Omega) is used to represent
(i) The upper bound (Worst-case)
(ii) The lower bound (Best-case)
(iii) The tight bound (Average-case)
(iv) None of the aboveQ1c. The recurrence T(n) = T(n/2) + 1 has a time complexity of: (i) O(n) (ii) O(\log n) (iii) O(n \log n) (iv) O(n^2)20242m
Module 1: Introduction
View this question on its own page →The recurrence has a time complexity of:
(i)
(ii)
(iii)
(iv)Q1d. Which sorting algorithm is considered stable and has a time complexity of O(n^2)? (i) Quick sort (ii) Merge sort (iii) Insertion sort (iv) Selection sort20232m
Module 1: Introduction
View this question on its own page →Which sorting algorithm is considered stable and has a time complexity of ?
(i) Quick sort
(ii) Merge sort
(iii) Insertion sort
(iv) Selection sortQ1e. What is the complexity of T(n) = 2T(n/4) + n^2 \log n? (i) \Theta(n^2 \log(\log n)) (ii) \Theta(n^3 \log n) (iii) \Theta(n^2 \log n) (iv) \Theta(n \log n)20232m
Module 1: Introduction
View this question on its own page →What is the complexity of ?
(i)
(ii)
(iii)
(iv)Q1f. Which one of the following functions is asymptotically smallest? (i) 2^n (ii) n^{\log n} (iii) n^{\sqrt{n}} (iv) (100)^{(\log n)^{1/3}} + (\log \log n)^{2/3}20222m
Module 1: Introduction
View this question on its own page →Which one of the following functions is asymptotically smallest?
(i)
(ii)
(iii)
(iv)Q1f. In algorithm analysis, what does "space complexity" refer to? (i) The number of input elements (ii) The amount of physical memory used (iii) The number of recursive calls (iv) The number of lines of code in the algorithm20232m
Module 1: Introduction
View this question on its own page →In algorithm analysis, what does "space complexity" refer to?
(i) The number of input elements
(ii) The amount of physical memory used
(iii) The number of recursive calls
(iv) The number of lines of code in the algorithmQ1h. The average number of comparisons performed by merge sort algorithm in merging two sorted lists of 2 elements is (i) 8/5 (ii) 11/7 (iii) 11/6 (iv) 8/320222m
Module 1: Introduction
View this question on its own page →The average number of comparisons performed by merge sort algorithm in merging two sorted lists of 2 elements is
(i) 8/5
(ii) 11/7
(iii) 11/6
(iv) 8/3Q2a. Explain the concept of asymptotic notation (Big O, Big Omega, and Big Theta) in algorithm analysis.20237m
Module 1: Introduction
View this question on its own page →Explain the concept of asymptotic notation (Big O, Big Omega, and Big Theta) in algorithm analysis.
Q2a. Answer the following: (i) Differentiate between best-case, worst-case, and average-case complexity with suitable examples. (ii) Use examples like linear search to demonstrate the differences. (iii) Discuss why worst-case analysis is often preferred in practice.20247m
Module 1: Introduction
View this question on its own page →Answer the following:
(i) Differentiate between best-case, worst-case, and average-case complexity with suitable examples.
(ii) Use examples like linear search to demonstrate the differences.
(iii) Discuss why worst-case analysis is often preferred in practice.Q2a. Solve the following recurrence by successive substitution method: f(1) = 1 \quad \text{if } n=1 f(n) = 3f(n/2) + 6 \quad \text{if } n > 120227m
Module 1: Introduction
View this question on its own page →Solve the following recurrence by successive substitution method:
Q2b. Consider the following recurrence relation: T(n) = 2T(n/2) + n Use the substitution method to find an asymptotic upper bound for the function T(n).20237m
Module 1: Introduction
View this question on its own page →Consider the following recurrence relation:
Use the substitution method to find an asymptotic upper bound for the function .Q2b. Suppose the number of basic operations in an algorithm is defined as: T(n) = T(n-1) + n, with T(1) = 1. Solve this recurrence using the substitution method and determine the time complexity.20247m
Module 1: Introduction
View this question on its own page →Suppose the number of basic operations in an algorithm is defined as: , with .
Solve this recurrence using the substitution method and determine the time complexity.Q2b. Define time complexity and space complexity. Write an algorithm for adding n natural numbers and find the space required by that algorithm.20257m
Module 1: Introduction
View this question on its own page →Define time complexity and space complexity. Write an algorithm for adding n natural numbers and find the space required by that algorithm.
Q3a. Apply the Master Theorem to determine the time complexity of the following recurrence relations. (i) T(n) = 4T(n/2) + n^3 (ii) T(n) = T(n/2) + 2^n20235m
Module 1: Introduction
View this question on its own page →Apply the Master Theorem to determine the time complexity of the following recurrence relations.
(i)
(ii)Q3a. What is the Master's Theorem? State the general form and the three cases of the theorem. Use it to solve the following recurrence relations: (i) T(n) = 2T(n/2) + n (ii) T(n) = 3T(n/2) + n^2 (iii) T(n) = 2T(n/2) + n/\log n Explain which case applies in each situation.20247m
Module 1: Introduction
View this question on its own page →What is the Master's Theorem? State the general form and the three cases of the theorem. Use it to solve the following recurrence relations:
(i)
(ii)
(iii)
Explain which case applies in each situation.Q3a. Discuss the concepts of asymptotic notations and its properties.20257m
Module 1: Introduction
View this question on its own page →Discuss the concepts of asymptotic notations and its properties.
Q4a. Apply the Linear Search algorithm to find the position of the target element 7 in the following array: A=[3, 5, 2, 8, 7, 1, 4]. Also, analyze the time and space complexity.20237m
Module 1: Introduction
View this question on its own page →Apply the Linear Search algorithm to find the position of the target element 7 in the following array: . Also, analyze the time and space complexity.
Q8b. State master's theorem and find the time complexity for the following recurrence: T(n) = 2T(n^{1/2}) + \log n20227m
Module 1: Introduction
View this question on its own page →State master's theorem and find the time complexity for the following recurrence:
Q9. Write short notes on any two of the following: (i) Asymptotic Notations (ii) Clique decision problem (iii) Max-flow-min-cut theorem (iv) Union-Find Algorithm202214m
Module 1: Introduction
View this question on its own page →Write short notes on any two of the following:
(i) Asymptotic Notations
(ii) Clique decision problem
(iii) Max-flow-min-cut theorem
(iv) Union-Find AlgorithmQ9b. Write a short note on: Recursion tree method20257m
Module 1: Introduction
View this question on its own page →Write a short note on:
Recursion tree method
Q9d. Write a short note on: Asymptotic Notations20257m
Module 1: Introduction
View this question on its own page →Write a short note on:
Asymptotic Notations