Let \( r_i(z) \) and \( w_i(z) \) denote read and write operations respectively on a data item \( z \) by a transaction \( T_i \). Consider the following two schedules.
\[ \begin{aligned} S_1 &: r_1(x)\; r_1(y)\; r_2(x)\; r_2(y)\; w_2(y)\; w_1(x) \\ S_2 &: r_1(x)\; r_2(x)\; r_2(y)\; w_2(y)\; r_1(y)\; w_1(x) \end{aligned} \] Which one of the following options is correct?
Step 1: Analyze schedule \(S_1\).
Conflicting operations occur on both data items \(x\) and \(y\).
- On \(x\): \(r_2(x)\) occurs before \(w_1(x)\), giving an edge \(T_2 \rightarrow T_1\).
- On \(y\): \(r_1(y)\) occurs before \(w_2(y)\), giving an edge \(T_1 \rightarrow T_2\).
Step 2: Check for cycles in precedence graph of \(S_1\).
The graph contains a cycle \(T_1 \rightarrow T_2 \rightarrow T_1\). Hence, \(S_1\) is not conflict serializable.
Step 3: Analyze schedule \(S_2\).
- On \(x\): \(r_1(x)\) occurs before \(w_1(x)\), and \(r_2(x)\) does not conflict in reverse order.
- On \(y\): \(r_2(y)\) and \(w_2(y)\) occur before \(r_1(y)\), giving a single edge \(T_2 \rightarrow T_1\).
Step 4: Check for cycles in precedence graph of \(S_2\).
The precedence graph has no cycle and corresponds to serial order \(T_2 \rightarrow T_1\).
Step 5: Conclusion.
Thus, \(S_1\) is not conflict serializable, while \(S_2\) is conflict serializable.
Final Answer: (B)
In a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is ______________. {(Answer in integer)}
Consider the following C code segment:
int x = 126, y = 105;
do {
if (x > y)
x = x - y;
else
y = y - x;
} while (x != y);
printf("%d", x);
The output of the given C code segment is ____________. (Answer in integer)
The following two signed 2’s complement numbers (multiplicand \( M \) and multiplier \( Q \)) are being multiplied using Booth’s algorithm:
| Multiplicand (\( M \)) | Multiplier (\( Q \)) |
|---|---|
| 1100 1101 1110 1101 | 1010 0100 1010 1010 |
The total number of addition and subtraction operations to be performed is __________. (Answer in integer)
The maximum value of \(x\) such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is __________ (answer in integer).
Consider the following C program
The value printed by the given C program is __________ (Answer in integer).