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**.
Suppose a minimum spanning tree is to be generated for a graph whose edge weights are given below. Identify the graph which represents a valid minimum spanning tree?
\[\begin{array}{|c|c|}\hline \text{Edges through Vertex points} & \text{Weight of the corresponding Edge} \\ \hline (1,2) & 11 \\ \hline (3,6) & 14 \\ \hline (4,6) & 21 \\ \hline (2,6) & 24 \\ \hline (1,4) & 31 \\ \hline (3,5) & 36 \\ \hline \end{array}\]
Choose the correct answer from the options given below:
Match LIST-I with LIST-II
Choose the correct answer from the options given below:
Consider the following set of processes, assumed to have arrived at time 0 in the order P1, P2, P3, P4, and P5, with the given length of the CPU burst (in milliseconds) and their priority:
\[\begin{array}{|c|c|c|}\hline \text{Process} & \text{Burst Time (ms)} & \text{Priority} \\ \hline \text{P1} & 10 & 3 \\ \hline \text{P2} & 1 & 1 \\ \hline \text{P3} & 4 & 4 \\ \hline \text{P4} & 1 & 2 \\ \hline \text{P5} & 5 & 5 \\ \hline \end{array}\]
Using priority scheduling (where priority 1 denotes the highest priority and priority 5 denotes the lowest priority), find the average waiting time.
Match LIST-I with LIST-II
\[\begin{array}{|c|l|}\hline \textbf{LIST-I} & \textbf{LIST-II} \\ \hline \text{A. Encipherment} & \text{The use of mathematical algorithms to transform data into a form that is not readily intelligible.} \\ \hline \text{B. Digital Signature} & \text{Cryptographic transformation of a data unit that allows a recipient of the data unit to prove the source and integrity of the data unit and protect against forgery.} \\ \hline \text{C. Access Control} & \text{A variety of mechanisms that enforce access rights to resources.} \\ \hline \text{D. Data Integrity} & \text{A variety of mechanisms used to assure the integrity of a data unit or stream of data units.} \\ \hline \end{array}\]
\[\text{Matching\ Items\ in\ LIST\-I\ with\ LIST\-II}\]