1) Suppose u and v both have values of type set and u^v == u – v. From this we can conclude that:

a) u and v are identical
b) u and v are disjoint
c) u is a subset of v
d) v is a subset of u

Answer(s) : 
d) v is a subset of u

2) Suppose u and v both denote sets in Python. Under what condition can we guarantee that u – (u – v) == v?

a) This is true for any u and v.
b) The set u should be a subset of v.
c) The set v should be a subset of u.
d) The sets u and v should be disjoint.

Answer(s) : 
c) The set v should be a subset of u.

3) We have a list of values [17,98,89,42,67,54,89,25,38]. Suppose we build a max-heap by starting with an empty heap and inserting each value from the list into the heap, from left to right. The resulting heap will then be:

a) [98,67,89,38,42,54,89,17,25]
b) [98,89,67,42,17,89,54,25,38]
c) [98,89,89,67,54,42,38,25,17]
d) [98,89,67,17,42,54,89,25,38]

Answer(s) : 
a) [98,67,89,38,42,54,89,17,25]

4) Suppose we insert the value 97 into the heap built in the previous question. The resulting heap will then be:

a) [98,97,67,42,89,89,54,25,38,17]
b) [98,97,89,67,89,42,38,25,17,54]
c) [98,97,89,38,67,54,89,17,25,42]
d) [98,97,89,67,17,89,54,25,38,42]

Answer(s) : 
c) [98,97,89,38,67,54,89,17,25,42]
Categories: NPTEL solution

6 Comments

shiv · September 5, 2017 at 6:44 PM

thanks

Aq · September 7, 2017 at 12:12 PM

Thanks

Aq · September 7, 2017 at 12:13 PM

Thanks…

Unknown · September 9, 2017 at 9:32 AM

Sir can you upload week 6 programming assignment solution

vk · February 18, 2018 at 7:15 AM

pllz post answers for python quiz 2 (2018) anf for assignment 2 alsoo

    Yash Sodha · February 20, 2018 at 4:31 PM

    Hey! Posted! Keep supporting!

Leave a Reply

Your email address will not be published. Required fields are marked *