Design and analysis of algorithms Nptel Week 1 Quiz Answers

Are you looking for Nptel Design and analysis of algorithms Week 1 Quiz Answers? You are here at right place for Nptel assignment answers.


Design and analysis of algorithms Week 1 Quiz Answers
Design and analysis of algorithms Week 1 Quiz Answers

Design and analysis of algorithms Week 1 Quiz Answers (Jan-Apr 2025)

Course link: Click here


Que. 1) An algorithm has two phases. The first phase, initialization, takes time O(n3)O(n^3). The second phase, which is the main computation, takes time O(n2)O(n^2). What is the most accurate description of the complexity of the overall algorithm?

a) O(n6)O(n^6)
b) O(n5)O(n^5)
c) O(n3)O(n^3)
d) O(n2)O(n^2)

Answer: Updating soon (in progress)


Que. 2) We are using a computer that performs 10810^8 basic operations per second. We are trying to determine the worst-case time complexity of a library function that is provided to us, whose code we cannot read. We test the function by feeding large numbers of random inputs of different sizes. We find that for inputs of size 50 the function always returns well within one second, for inputs of size 500 it sometimes takes a couple of seconds, and for inputs of size 5,000 it sometimes takes over 15 minutes. What is a reasonable conclusion we can draw about the worst-case time complexity of the library function?

a) O(n4)O(n^4)
b) O(n3)O(n^3)
c) O(n2log⁡n)O(n^2 \log n)
d) O(n2)O(n^2)

Answer: Updating soon (in progress)


Que. 3) Suppose f(n)=2n2+4n+5f(n) = 2n^2 + 4n + 5 and g(n)=7n3+5n2+12g(n) = 7n^3 + 5n^2 + 12. Let h(n)h(n) be a third, unknown function. Which of the following is not possible?

a) h(n)h(n) is O(f(n))O(f(n)) and h(n)h(n) is also O(g(n))O(g(n))
b) h(n)h(n) is not O(f(n))O(f(n)) and h(n)h(n) is also not O(g(n))O(g(n))
c) h(n)h(n) is O(f(n))O(f(n)) but h(n)h(n) is not O(g(n))O(g(n))
d) h(n)h(n) is O(g(n))O(g(n)) but h(n)h(n) is not O(f(n))O(f(n))

Answer: Updating soon (in progress)


Que. 4) How many times is the comparison i≤ni \leq n performed in the following program?

int i = 60, n = 300;
main(){
  while (i <= n){
    i = i + 2;
    n = n - 3; 
  }
}

a) 48
b) 49
c) 50
d) 51

Answer: Updating soon (in progress)


Que. 5) If T(n)T(n) is O(n4/3)O(n^{4/3}), which of the following is false?

a) T(n)T(n) is O(nlog⁡n)O(n \log n)
b) T(n)T(n) is O(n2)O(n^2)
c) T(n)T(n) is O(n2log⁡n)O(n^2 \log n)
d) T(n)T(n) is O(n3)O(n^3)

Answer: Updating soon (in progress)


For answers or latest updates join our telegram channel: Click here to join

These are Design and analysis of algorithms Week 1 Quiz Answers

More Answers of Design and analysis of algorithms Week 1 Quiz Answers: Click here

For answers to additional Nptel courses, please refer to this link: NPTEL Assignment