# Recent questions tagged isi2018-pcb-cs

0 votes
2 answers
1
Consider two $n \times 1$ vectors $u$ and $v$ , stored as table $U(\text{ind,val})$ and $V(\text{ind,val})$ with the same schema A row $(i,u_i)$ of table $U$ specifies the $i^{th}$ element of vector $u$ has value $u_i$ (similarly for $v$, ... $u + v$ of the two vectors $u$ and $v$. Explain your solution.
1 vote
0 answers
2
The data link layer uses a fixed-size sliding window protocol, where the window size for the connection is equal to twice the bandwidth-delay product of the network path. Consider the following three scenarios, in each of which only the given parameter changes as specified (no other ... the minimum value of the round trip time $R$ increases to $1.8R$; the window size $W$ decreases to $W/3$
0 votes
2 answers
3
Consider a $5$ ... $\text{(in ns)}$ needed to execute the program.
1 vote
2 answers
4
A context switch from a process $P_{old}$ to a process $P_{new}$ consists of the following steps: Step I:saving the context of $P_{old}$; Step II: running the scheduling algorithm to pick $P_{new}$; Step III: restoring the saved context of $P_{new}$. Suppose Steps I and ... same instant in the order $P_1, P_2, . . . , P_k;$ each process requires exactly one CPU burst of $20$ms and no I/O burst.
0 votes
1 answer
5
The following function computes an array $SPF$, where, for any integer $1 < i < 1000$, $SPF[i]$ is the smallest prime factor of $i$. For example, $SPF[6]$ is $2$, and $SPF[11]$ is $11$. There are five missing parts in the following code, commented as $/* Blank */$. For each of them, copy the entire ... ; j < 1000; j+= i) { /* Blank 4 */ if (SPF[j] == j) { SPF[j] = _____; /* Blank 5 */ } } } } }
0 votes
1 answer
6
Consider a max-heap of $n$ distinct integers, $n ≥ 4$, stored in an array $\mathcal{A}[1 . . . n]$. The second minimum of $\mathcal{A}$ is the integer that is less than all integers in $\mathcal{A}$ except the minimum of $\mathcal{A}$. Find all possible array indices of $\mathcal{A}$ in which the second minimum can occur. Justify your answer.
1 vote
1 answer
7
Let the valid moves along a staircase be $U$ (one step up) and $D$ (one step down). For example, the string $s = UUDU$ represents the sequence of moves as two steps up, then one step down, and then again one step up. Suppose a person is initially at the ... never returns to the base of the staircase after the final step. Show that $L$ is not regular Write a context free grammar for accepting $L$
1 vote
1 answer
8
An $n-$variable Boolean function $f:\{0,1\}^n \rightarrow \{0,1\}$ is called symmetric if its value depends only on the number of $1’s$ in the input. Let $\sigma_n$ denote the number of such functions. Calculate the value of $\sigma_4$. Derive an expression for $\sigma_n$ in terms of $n$.
2 votes
1 answer
9
You can climb up a staircase of $n$ stairs by taking steps of one or two stairs at a time. Formulate a recurrence relation for counting $a_n$, the number of distinct ways in which you can climb up the staircase. Mention the boundary conditions for your recurrence relation. Find a closed form expression for $a_n$ by solving your recurrence.
0 votes
1 answer
10
Consider an array of length n consisting only of positive and negative integers. Design an algorithm to rearrange the array so that all the negative integers appear before all the positive integers, using $O(n)$ time and only a constant amount of extra space.
To see more, click for the full list of questions or popular tags.