Programming Data Structure And Algorithms Using Python Assignment 6

                     

Course Name: Programming Data Structure And Algorithms Using Python

Link of Course: Click Here

These are the solutions of Programming Data Structure And Algorithms Using Python Assignment 6


Q1. Suppose u and v both have values of type set and are disjoint. Which of the following expressions evaluates to True?
a. u == v | (u^v)
b. u == (v^u)
c. u == v^(u | v)
d. u == u^(v | u)

Answer: c


Q2. Suppose u and v both denote sets in Python. What is the most general condition that guarantees that u|v = uv?
a. The sets u and v should be disjoint.
b. The set u should be a subset of the set v.
c. The set v should be a subset of the set u.
d. This is true for any u and v.

Answer: a


These are the solutions of Programming Data Structure And Algorithms Using Python Assignment 6


Q3. Consider the min-heap [15, 27, 33, 39, 66, 39, 47, 58, 51]. built by repeatedly inserting values into an empty heap. Which of the following could not have been the last element inserted into this heap?
a. 27
d. 15
c. 58
d. 51

Answer: c


Q4. Suppose we execute delete-min twice on the min-heap [13,29,24,67,52,89,45,98.79,58]. What is the resulting heap?

Answer: [29, 52, 45, 67, 79, 89, 58, 98]


These are the solutions of Programming Data Structure And Algorithms Using Python Assignment 6

All weeks solution of Programming Data Structure And Algorithms Using Python: https://progies.in/answers/nptel/programming-data-structure-and-algorithms-using-python

More NPTEL Solutions: https://progies.in/answers/nptel


* The material and content uploaded on this website are for general information and reference purposes only. Please do it by your own first.


These are the solutions of Programming Data Structure And Algorithms Using Python Assignment 6