Given a pipeline with 5 stages, the delay for each stage is as follows:
\[ \begin{array}{|c|c|} \hline \textbf{Stage} & \textbf{Delay (ns)} \\ \hline 1 & 250 \\ 2 & 150 \\ 3 & 100 \\ 4 & 200 \\ 5 & 50 \\ \hline \end{array} \]The buffer delay is 10 ns. Find the time for \( n = 1000 \) instructions.
Consider the following operations on an initially empty stack:
Push 10
Push 20
Pop
Push 30
Pop
Push 40
What is the final content of the stack?
Which of the following is true about the binary search algorithm when applied to a sorted array?
What is the output of the following C code?
void foo(int *p, int x) { *p = x; } void main() { int *z; int a = 20, b = 25; z = a; // Incorrect: Should be z = a; foo(z, b); printf("%d", a); }
Issue: The statement z = a;
is invalid because a
is an integer, and z
is a pointer.
Which of the following is the greatest? \[ 0.6, \ 0.666, \ \frac{5}{6}, \ \frac{2}{3} \]
Consider the following C code:
int main() { sum = 0; for (n = 1; n < 3; n++) { n++; sum += g(f(n)); } printf("%d", sum); } int g(n) { return 10 + n; } int f(n) { return g(2 * n); }
What is the output?