Identify-Function

Question 1

A set X can be represented by an array x[n] as follows:

Consider the following algorithm in which x,y and z are Boolean arrays of size n:

algorithm zzz(x[] , y[], z [])
{
   int i;
   for (i=O; i<n; ++i)
     z[i] = (x[i] ^ ~y[i]) V (~x[i] ^ y[i])
}

The set Z computed by the algorithm is:

A
(X ∪ Y)
B
(X ∩ Y)
C
(X-Y) ∩ (Y-X)
D
(X-Y) ∪ (Y-X)
Question 1 Explanation: 
X[i] ∧ ~Y[i] can be written as X - Y.
~X[i] ∧ Y[i] can be written as Y - X.
'∨' can be written as Union.
∴ (X-Y) Union (Y-X)
There is 1 question to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access