GATE 2019
65 questions
MCQ 41 · NAT 241-mark 30 · 2-mark 35
Questions 21–25 of 65
Consider the following two statements about database transaction schedules:
I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.
II. Timestamp-ordering concurrency control protocol with Thomas' Write Rule can generate view serializable schedules that are not conflict serializable.
Which of the above statements is/are TRUE?
I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.
II. Timestamp-ordering concurrency control protocol with Thomas' Write Rule can generate view serializable schedules that are not conflict serializable.
Which of the above statements is/are TRUE?
Answer: (C)
Let us check both statements one by one.
- Strict 2PL keeps all exclusive locks until the transaction commits. So its schedules are conflict serializable, and no transaction reads data that is not yet committed the schedule is recoverable Statement I is TRUE.
- Thomas' write rule skips obsolete writes. Because of this, some schedules are view serializable but not conflict serializable (blind writes) Statement II is TRUE.
Answer: Both I and II
- Strict 2PL keeps all exclusive locks until the transaction commits. So its schedules are conflict serializable, and no transaction reads data that is not yet committed the schedule is recoverable Statement I is TRUE.
- Thomas' write rule skips obsolete writes. Because of this, some schedules are view serializable but not conflict serializable (blind writes) Statement II is TRUE.
Answer: Both I and II
Let G be an undirected complete graph on n vertices, where n2. Then, the number of different Hamiltonian cycles in G is equal to
Answer: (D) or (C)
Choose any one vertex as the starting point. The other n 1 vertices can be placed in (n 1)! different orders. Every cycle gets counted two times, once for each direction.
So the number of Hamiltonian cycles
Answer:
So the number of Hamiltonian cycles
Answer:
Compute
Answer: (C)
Factor the top and bottom, then cancel the common (x 3):
Factored and cancelled form:
Put x = 3:
Value at x = 3:
Answer: 108/7
Factored and cancelled form:
Put x = 3:
Value at x = 3:
Answer: 108/7
Which one of the following statements is NOT correct about the tree data structure used for creating an index of a relational database table?
Answer: (B)
Only the leaf nodes of a tree point to data records. Non-leaf nodes store just keys and pointers to their child nodes.
The remaining statements are correct: the tree is height balanced, keys are sorted, and the leaves are linked to each other.
Answer: Non-leaf nodes have pointers to data records
The remaining statements are correct: the tree is height balanced, keys are sorted, and the leaves are linked to each other.
Answer: Non-leaf nodes have pointers to data records
For , let us consider the regular language
.
Which one of the following can be a pumping length (the constant guaranteed by the pumping lemma) for L?
.
Which one of the following can be a pumping length (the constant guaranteed by the pumping lemma) for L?
Answer: (D)
A valid p has to be bigger than the length of any string that cannot be pumped.
- The string cannot be pumped. If any part is removed, fewer than 10 b's are left, and that is not in L. So p must be at least 11 so 3, 5 and 9 fail.
- Take p = 24. Every b-string with length (34, 46, ) can be pumped using within the first 24 symbols. Every a-string can be pumped using .
Answer: 24
- The string cannot be pumped. If any part is removed, fewer than 10 b's are left, and that is not in L. So p must be at least 11 so 3, 5 and 9 fail.
- Take p = 24. Every b-string with length (34, 46, ) can be pumped using within the first 24 symbols. Every a-string can be pumped using .
Answer: 24