GATE 2021 (Session 2)
64 questions
MCQ 33 · MSQ 13 · NAT 181-mark 29 · 2-mark 35
Questions 11–15 of 64
Let G be a connected undirected weighted graph. Consider the following two statements.
S1: There exists a minimum weight edge in G which is present in every minimum spanning tree of G.
S2: If every edge in G has distinct weight, then G has a unique minimum spanning tree.
Which one of the following options is correct?
S1: There exists a minimum weight edge in G which is present in every minimum spanning tree of G.
S2: If every edge in G has distinct weight, then G has a unique minimum spanning tree.
Which one of the following options is correct?
Answer: (C)
- S1 is false. Take a triangle with all weights 1. Every MST has 2 of the 3 edges, so each minimum weight edge is left out by some MST. So no minimum weight edge is present in every MST.
- S2 is true. Suppose two different MSTs and exist. Let e be the lightest edge that is in exactly one of them, say in . Adding e to makes a cycle. This cycle has an edge f that is not in (as has no cycle), so f is in exactly one tree and . Then is a spanning tree lighter than , which is impossible.
So S1 is false and S2 is true.
Answer: (C)
- S2 is true. Suppose two different MSTs and exist. Let e be the lightest edge that is in exactly one of them, say in . Adding e to makes a cycle. This cycle has an edge f that is not in (as has no cycle), so f is in exactly one tree and . Then is a spanning tree lighter than , which is impossible.
So S1 is false and S2 is true.
Answer: (C)
Let H be a binary min-heap consisting of n elements implemented as an array. What is the worst case time complexity of an optimal algorithm to find the maximum element in H?
Answer: (C)
The largest value in a min-heap must be at one of the leaves. The leaves have no order among themselves, so we have to look at every one of them. This takes .
Answer:
Answer:
The format of the single-precision floating point representation of a real number as per the IEEE 754 standard is as follows:
Which one of the following choices is correct with respect to the smallest normalized positive number represented using the standard?
Which one of the following choices is correct with respect to the smallest normalized positive number represented using the standard?
Answer: (C)
A normalized number must have an exponent field from 1 to 254. The value 0 is kept for zero and denormals. So the smallest normalized positive number has exponent 00000001 and a mantissa of all 0s: .
Answer: exponent = 00000001 and mantissa = 00
Answer: exponent = 00000001 and mantissa = 00
Which one of the following circuits implements the Boolean function given below?
where is the minterm.
where is the minterm.
Answer: (A)
The select lines are y (s1) and z (s0). So each data input has to match f, with x left free.
- For yz = 00: m0 (x = 0) and m4 (x = 1) are both 1
- For yz = 01: m1 and m5 are both 1
- For yz = 10: m2 = 0 and m6 = 1
- For yz = 11: m3 = 1 and m7 = 0
The inputs are (1, 1, x, x'), which is circuit A.
Answer: A
- For yz = 00: m0 (x = 0) and m4 (x = 1) are both 1
- For yz = 01: m1 and m5 are both 1
- For yz = 10: m2 = 0 and m6 = 1
- For yz = 11: m3 = 1 and m7 = 0
The inputs are (1, 1, x, x'), which is circuit A.
Answer: A
Consider the following statements S1 and S2 about the relational data model:
S1: A relation scheme can have at most one foreign key.
S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.
Which one of the following choices is correct?
S1: A relation scheme can have at most one foreign key.
S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.
Which one of the following choices is correct?
Answer: (D)
Let us check both statements one by one.
- S1: a relation can have more than one foreign key (for example, Enrolment(studentId, courseId) points to two tables) so S1 is FALSE.
- S2: a foreign key can point to the same relation (for example, Employee.managerId Employee.empId) so S2 is FALSE.
Answer: Both S1 and S2 are false
- S1: a relation can have more than one foreign key (for example, Enrolment(studentId, courseId) points to two tables) so S1 is FALSE.
- S2: a foreign key can point to the same relation (for example, Employee.managerId Employee.empId) so S2 is FALSE.
Answer: Both S1 and S2 are false