# Recent questions tagged isi2016-pcb-cs

1 vote
1
Consider the array $A=[20,13,19,8,3,5,4]$ that represents a heap. Draw the heap after removing the element $20.$ List all the distinct integer keys $k$ such that, when $k$ is inserted in the Binary Search Tree of Figure $1,$ its height increases. Note that you are not allowed to insert an already existing key again. Justify your answer.
2
Consider sending a large file of $360,000$ bits from Host $A$ to Host $B,$ connected through a router, as shown in the below figure $2.$ Assume that there is no queuing and propagation delay, and the router has sufficient buffer space. Host $A$ ... assume that transferring one byte involves $4$ operations: in-status, check-status, branch and read/write in memory, each requiring one machine cycle.
1 vote
3
Consider the following extract from a program, written in a C-like language, that computes the transpose of a matrix. for (i=0; i<N; i++) for (j=0; j<N; j++) B[i,j]=A[i,j]; $A$ and $B$ are $N \times N$ matrices with floating point entries that are ... bytes Each of $A$ and $B$ is stored starting from the beginning of a page None of the pages allocated to $A$ and $B$ are initially in memory.
4
Commodity items have some positive or negative changes in their prices each week. Each trading company picks a portfolio of commodity items, that is, they have one or more items and they own some non-zero quantity of each one. The database table for this problem consists of the ... items and there exists at least one company selling that item only. (i.e., not selling any other item) in that week.
5
What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case, your answer must include proper justifications without which no credit will be given. #include<stdio.h> main() { unsigned char i, j, a[]={1, 2, 3, 4, 5}; int n; i=j=n=5; while ... =%d, n=%d\n", i, j, n); while(j-- !=0) a[0]+=n; printf("j=%d, a[0]=%d\n", j, a[0]); }
Let L be a regular language over $\{0,1\}$. Define the reverse of the language $L$ to be the language $L^R = \{ w \in \{0,1\}^* \: \: : \: \: \text{ reverse }(w) \in L\}$, where $\text{reverse}(w)$ denotes the string $w$ ... $x$ contains an odd number of $1's$ and $00$ as a substring$\}.$ Construct a regular expression for the language $L$.
Let $A$ be a sorted array of $n$ positive integers, such that $A[1] \leq A[2] \leq \dots \leq A[n]$. Given an integer $x$ as input, the goal is to find two array indices $k$ and $l$ such that $A[k]+A[l] =x$, if such indices exist; otherwise, the goal is to report 'Failure". Design an algorithm for this problem, that works in $O(n)$ time.
Consider all possible trees with $n$ nodes. Let $k$ be the number of nodes with degree greater than 1 in a given tree. What is the maximum possible value of $k$? Justify your answer. Consider $2n$ committees, each having at least $2n$ persons, formed from a group of $4n$ persons. Prove that there exists at least one person who belongs to at least $n$ committees.