September 2023

The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7}exactly once is

The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7}exactly once is

Q. The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7}exactly once is Ans: 80 Sol: Set minimum element as root (i.e 1), now 6 are remaining and left subtree will have 3 elements, each left subtree combination can be permuted in 2! ways. Total ways to design min-heap with 7-elements = ^6C_3 *2! * 2! = 20*2*2 = 80

The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7}exactly once is Read More »

Consider Guwahati (G) and Delhi (D) whose temperatures can be classified as high (𝐻), medium (𝑀) and low (𝐿)

Consider Guwahati (G) and Delhi (D) whose temperatures can be classified as high (𝐻), medium (𝑀) and low (𝐿)

Q. Consider Guwahati (G) and Delhi (D) whose temperatures can be classified as high (𝐻), medium (𝑀) and low (𝐿). Let 𝑃(𝐻𝐺) denote the probability that Guwahati has high temperature. Similarly, 𝑃(𝑀𝐺) and 𝑃(𝐿𝐺) denotes the probability of Guwahati having medium and low temperatures respectively. Similarly, we use 𝑃(𝐻𝐷), 𝑃(𝑀𝐷) and 𝑃(𝐿𝐷) for Delhi. The

Consider Guwahati (G) and Delhi (D) whose temperatures can be classified as high (𝐻), medium (𝑀) and low (𝐿) Read More »

Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of the numbers 1,2, … , 100

Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of the numbers 1,2, … , 100

Q. Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of the numbers 1,2, … , 100. There is an edge between vertices 𝑢 and 𝑣 if and only if the label of 𝑢 can be obtained by swapping two adjacent numbers in the label of 𝑣. Let

Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of the numbers 1,2, … , 100 Read More »

Consider the following four relational schemas. For each schema, all non-trivial functional dependencies are listed

Consider the following four relational schemas. For each schema, all non-trivial functional dependencies are listed

Q. Consider the following four relational schemas. For each schema, all non-trivial functional dependencies are listed. The underlined attributes are the respective primary keys. Schema I: Registration (rollno, courses) Field ‘courses’ is a set-valued attribute containing the set of courses a student has registered for. Non-trivial functional dependency: rollno ® courses Schema II: Registration (rollno,

Consider the following four relational schemas. For each schema, all non-trivial functional dependencies are listed Read More »

Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key referencing s.B

Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key referencing s.B

Q. Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key referencing s.B. Consider the query Q:   𝑟 ⋈ (𝜎𝐵<5(𝑠)) Let LOJ denote the natural left outer-join operation. Assume that r and s contain no null values. Which one of the following queries is NOT

Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key referencing s.B Read More »

Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is 𝑁

Consider the following solution to the producer-consumer synchronization problem

Q. Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is 𝑁. Three semaphores empty, full and mutex are defined with respective initial values of 0, 𝑁 and 1. Semaphore empty denotes the number of available slots in the buffer, for the consumer to read from. Semaphore full denotes the number

Consider the following solution to the producer-consumer synchronization problem Read More »

Scroll to Top