Design and Analysis of Algorithms

106502
Back to Design and Analysis of Algorithms

Module 1: Introduction

  1. 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

    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 used

    View this question on its own page →
  2. Q1a. 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

    Which property of an algorithm ensures that every step is clear and has exactly one meaning?

    (i) Finiteness
    (ii) Effectiveness
    (iii) Definiteness
    (iv) Generality

    View this question on its own page →
  3. Q1a. 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

    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-notation

    View this question on its own page →
  4. Q1b. 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

    An algorithm is made up of two independent time complexities f(n)f(n) and g(n)g(n). Then the complexities of the algorithm is in the order of
    (i) f(n)×g(n)f(n) \times g(n)
    (ii) max{f(n),g(n)}\max \{ f(n), g(n) \}
    (iii) min{f(n),g(n)}\min \{ f(n), g(n) \}
    (iv) f(n)+g(n)f(n) + g(n)

    View this question on its own page →
  5. 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

    If an algorithm has time complexity T(n)=5n2+3n+7T(n) = 5n^2 + 3n + 7, its asymptotic upper bound is:
    (i) O(n)O(n)
    (ii) O(n2)O(n^2)
    (iii) O(nlogn)O(n \log n)
    (iv) O(n3)O(n^3)

    View this question on its own page →
  6. 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

    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 above

    View this question on its own page →
  7. Q1c. 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

    The recurrence T(n)=T(n/2)+1T(n) = T(n/2) + 1 has a time complexity of:
    (i) O(n)O(n)
    (ii) O(logn)O(\log n)
    (iii) O(nlogn)O(n \log n)
    (iv) O(n2)O(n^2)

    View this question on its own page →
  8. 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

    Which sorting algorithm is considered stable and has a time complexity of O(n2)O(n^2)?
    (i) Quick sort
    (ii) Merge sort
    (iii) Insertion sort
    (iv) Selection sort

    View this question on its own page →
  9. Q1e. 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

    What is the complexity of T(n)=2T(n/4)+n2lognT(n) = 2T(n/4) + n^2 \log n?
    (i) Θ(n2log(logn))\Theta(n^2 \log(\log n))
    (ii) Θ(n3logn)\Theta(n^3 \log n)
    (iii) Θ(n2logn)\Theta(n^2 \log n)
    (iv) Θ(nlogn)\Theta(n \log n)

    View this question on its own page →
  10. 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

    Which one of the following functions is asymptotically smallest?
    (i) 2n2^n
    (ii) nlognn^{\log n}
    (iii) nnn^{\sqrt{n}}
    (iv) (100)(logn)1/3+(loglogn)2/3(100)^{(\log n)^{1/3}} + (\log \log n)^{2/3}

    View this question on its own page →
  11. 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

    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 algorithm

    View this question on its own page →
  12. Q1h. 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

    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/3

    View this question on its own page →
  13. Q2a. Explain the concept of asymptotic notation (Big O, Big Omega, and Big Theta) in algorithm analysis.20237m

    Module 1: Introduction

    Explain the concept of asymptotic notation (Big O, Big Omega, and Big Theta) in algorithm analysis.

    View this question on its own page →
  14. 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

    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.

    View this question on its own page →
  15. 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

    Solve the following recurrence by successive substitution method:
    f(1)=1if n=1f(1) = 1 \quad \text{if } n=1
    f(n)=3f(n/2)+6if n>1f(n) = 3f(n/2) + 6 \quad \text{if } n > 1

    View this question on its own page →
  16. 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

    Consider the following recurrence relation:
    T(n)=2T(n/2)+nT(n) = 2T(n/2) + n
    Use the substitution method to find an asymptotic upper bound for the function T(n)T(n).

    View this question on its own page →
  17. 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

    Suppose the number of basic operations in an algorithm is defined as: T(n)=T(n1)+nT(n) = T(n-1) + n, with T(1)=1T(1) = 1.
    Solve this recurrence using the substitution method and determine the time complexity.

    View this question on its own page →
  18. 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

    Define time complexity and space complexity. Write an algorithm for adding n natural numbers and find the space required by that algorithm.

    View this question on its own page →
  19. 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

    Apply the Master Theorem to determine the time complexity of the following recurrence relations.
    (i) T(n)=4T(n/2)+n3T(n) = 4T(n/2) + n^3
    (ii) T(n)=T(n/2)+2nT(n) = T(n/2) + 2^n

    View this question on its own page →
  20. 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

    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)+nT(n) = 2T(n/2) + n
    (ii) T(n)=3T(n/2)+n2T(n) = 3T(n/2) + n^2
    (iii) T(n)=2T(n/2)+n/lognT(n) = 2T(n/2) + n/\log n
    Explain which case applies in each situation.

    View this question on its own page →
  21. Q3a. Discuss the concepts of asymptotic notations and its properties.20257m

    Module 1: Introduction

    Discuss the concepts of asymptotic notations and its properties.

    View this question on its own page →
  22. 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

    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]A=[3, 5, 2, 8, 7, 1, 4]. Also, analyze the time and space complexity.

    View this question on its own page →
  23. 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

    State master's theorem and find the time complexity for the following recurrence:
    T(n)=2T(n1/2)+lognT(n) = 2T(n^{1/2}) + \log n

    View this question on its own page →
  24. 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

    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 Algorithm

    View this question on its own page →
  25. Q9b. Write a short note on: Recursion tree method20257m

    Module 1: Introduction

    Write a short note on:

    Recursion tree method

    View this question on its own page →
  26. Q9d. Write a short note on: Asymptotic Notations20257m

    Module 1: Introduction

    Write a short note on:

    Asymptotic Notations

    View this question on its own page →