GATEverse
← GATE CSE 2006

Q50

MCQ2 marks, −0.5

A set XX can be represented by an array x[n]x[n] as follows: x[i]={1if i∈X0otherwisex\left [ i \right ]=\begin {cases} 1 & \text{if } i \in X \\ 0 & \text{otherwise} \end{cases} Consider the following algorithm in which xx, yy, and zz are Boolean arrays of size nn: algorithm zzz(x[], y[], z[]) { int i; for(i=0; i<n; ++i) z[i] = (x[i] ∧ ~y[i]) ∨ (~x[i] ∧ y[i]); } The set ZZ computed by the algorithm is:

Sign in to save attempts.

Loading…