In C language, mat[i][j] is equivalent to: (where mat[i][j] is a two-dimensional array)
\(\texttt{*(mat + i) + j}\)
\(\texttt{(mat + i) + j}\)
\(\texttt{((mat * i) + j)}\)
\(\texttt{*(mat + i + j)}\)
Step 1: Understand how multi-dimensional arrays work in C.
In C, a 2D array is stored in a contiguous block of memory. To access an element at \( mat[i][j] \), you use a pointer arithmetic approach.
- **Option 1**: \(\texttt{*(mat + i) + j}\) is the correct way to access the element at \(mat[i][j]\), because it first calculates the address of the \(i^{th}\) row and then accesses the \(j^{th}\) column element.
Step 2: Evaluate other options.
- **Option 2**: This is not valid because \( (mat + i) + j \) is not a proper way to access the array element.
- **Option 3**: Incorrect, as this formulation tries to use multiplication on the array, which is not valid for accessing a specific element.
- **Option 4**: Incorrect. The formula \( *(mat + i + j) \) does not correctly access the element at row \(i\) and column \(j\).
Step 3: Conclusion.
Thus, the correct expression is **Option 1**.
Find the least upper bound and greatest lower bound of \( S = \{X, Y, Z\} \) if they exist, of the poset whose Hasse diagram is shown below:
Suppose \( D_1 = (S_1, \Sigma, q_1, F_1, \delta_1) \) and \( D_2 = (S_2, \Sigma, q_2, F_2, \delta_2) \) are finite automata accepting languages \( L_1 \) and \( L_2 \), respectively. Then, which of the following languages will also be accepted by the finite automata:
(A) \( L_1 \cup L_2 \)
(B) \( L_1 \cap L_2 \)
(C) \( L_1 - L_2 \)
(D) \( L_2 - L_1 \)
Choose the correct answer from the options given below: