# Recent activity by vijaycs

1
The subset-sum problem is defined as follows. Given a set of $n$ positive integers, $S = \{ a_1, a_2, a_3, \dots , a_n \}$, and positive integer $W$, is there a subset of $S$ whose elements sum to $W$? A dynamic program for solving this problem uses a $\text{2-dimensional}$ Boolean array, $X$ ... , implies that there is a subset whose elements sum to $W$? $X[1, W]$ $X[n, 0]$ $X[n, W]$ $X[n-1, n]$
2
The memory access time is $1$ $nanosecond$ for a read operation with a hit in cache, $5$ $nanoseconds$ for a read operation with a miss in cache, $2$ $nanoseconds$ for a write operation with a hit in cache and $10$ $nanoseconds$ for a write operation ... operations. The cache hit-ratio is $0.9$. The average memory access time (in nanoseconds) in executing the sequence of instructions is ______.
3
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.
4
For any natural number $n$, an ordering of all binary strings of length $n$ is a Gray code if it starts with $0^n$, and any successive strings in the ordering differ in exactly one bit (the first and last string must also differ by one bit). Thus, for $n=3$ ... Gray code, if two strings are separated by $k$ other strings in the ordering, then they must differ in exactly $k$ bits none of the above
5
Let $f \: \circ \: g$ denote function composition such that $(f \circ g)(x) = f(g(x))$. Let $f: A \rightarrow B$ such that for all $g \: : \: B \rightarrow A$ and $h \: : \: B \rightarrow A$ ... $f$ is one-to-one (injective) $f$ is both one-to-one and onto (bijective) the range of $f$ is finite the domain of $f$ is finite
6
1. Does starvation freedom imply bounded- waiting ? 2. Does bounded- waiting imply starvation freedom ? Explain with example.
7
A total of 9 units of a resource type available, and given the safe state shown below, which of the following sequence will be a safe state? Process Used Max $P_1$ 2 7 $P_2$ 1 6 $P_3$ 2 5 $P_4$ 1 4 $\langle P_4, P_1, P_3, P_2\rangle$ $\langle P_4, P_2, P_1, P_3\rangle$ $\langle P_4, P_2, P_3, P_1\rangle$ $\langle P_3, P_1, P_2, P_4 \rangle$
8
A multithreaded program $P$ executes with $x$ number of threads and uses $y$ number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock $l$, then it cannot re-acquire lock $l$ without releasing it. If a thread is ... deadlock are: $x = 1, y = 2$ $x = 2, y = 1$ $x = 2, y = 2$ $x = 1, y = 1$
9
10
Let there are n elements in array and number of sorted subarray is log n of size n/ log n each then what is the time complexity to sort given array
11
The next state table of a $2-$bit saturating up-counter is given below. $\begin{array}{cc|cc} Q_1 & Q_0 & Q_1^+ & Q_0^+ \\ \hline 0 & 0 & 0 & 1 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 1 & 1 \\ 1 & 1 & 1 & 1 \end{array}$ The counter is built as a synchronous sequential circuit ... $T_1 = Q_1+Q_0, \quad T_0= \bar{Q_1} \bar{Q_0}$ $T_1 = \bar{Q_1}Q_0, \quad T_0= Q_1 + Q_0$
12
If $w, x, y, z$ are Boolean variables, then which one of the following is INCORRECT? $wx+w(x+y)+x(x +y) = x+wy$ $\overline{w \bar{x}(y+\bar{z})} + \bar{w}x = \bar{w} + x + \bar{y}z$ $(w \bar{x}(y+x\bar{z}) + \bar{w} \bar{x}) y = x \bar{y}$ $(w+y)(wxy+wyz) = wxy+wyz$
13
Consider the table employee(empId, name, department, salary) and the two queries $Q_1, \, Q_2$ below. Assuming that department 5 has more than one employee, and we want to find the employees who get higher salary than anyone in the department 5, which one of the statements ... $Q_2$ is the correct query Both $Q_1$ and $Q_2$ produce the same answer Neither $Q_1$ nor $Q_2$ is the correct query
14
15
here SJF is given as well as priorities are given, given answer followes only priority scheduling but i think priority is used in case where there is a tie between two processes in SJF what is the correct approach?
16
In an $M \times N$ matrix all non-zero entries are covered in $a$ rows and $b$ columns. Then the maximum number of non-zero entries, such that no two are on the same row or column, is $\leq a +b$ $\leq \max(a, b)$ $\leq \min(M-a, N-b)$ $\leq \min(a, b)$
17
What is the difference betwen 2s complent of a number and 2s complement representation of a number .
18
Consider a disk queue with I/O requests on the following cylinders in their arriving order: 6, 10, 12, 54, 97, 73, 128, 15, 44, 110, 34, 45 The disk head is assumed to be at cylinder 23 and moving in the direction of decreasing number of cylinders. Total number of cylinders in the disk is 150. The disk head movement using SCAN-scheduling algorithm is: 172 173 227 228
19
For a database relation R(A,B,C,D) where the domains of A, B, C and D include only atomic values, only the following functional dependencies and those that can be inferred from them are: $A \rightarrow C$ $B \rightarrow D$ The relation R is in _____. First ... as well as in second normal form Second normal form but not in third normal form Both in second normal form as well as in third normal form
20
int loop(int n) { for(int i=1;i<=n;i++) { for(int j=1;j<n;j+=i) { -------------O(1)------------- } } } What is the time complexity of above code segment?
21
#include <stdio.h> int main(void) { for(i=1;i<=n;i*=2) { for(j=0;j<=i;j++) { for(k=0;k<=n;k++) { ..... O(1)....; } } } return 0; } What is the time complexity of given code ?
22
23
S : R1(x ) R2(x ) W1(x ) W2(x); Transactions can commit any place after their last operation executed. The number of statements are correct schedule (s) __________. 1. S is conflict serializable schedule. 2. S is view serializable schedule 3. S is recoverable schedule 4. S is cascadeless Rollback, Recoverable schedule 5. S is strict recoverable schedule.
24
consider a paging system with 48bit virtual address space.Each address defers to a byte in memory.suppose the size of page is 16KB and the main memory size is 16GB.The minimum size of page table with each entry need 2 protection bits is _____ (in GB) now what should be the ... 22bits. should i round it to 3bytes and make answer as 48GB or shuld i keep it as it is and write the answer as 44GB?
25
Consider the following schedule S : r1(A) w2(A) r3(A) w4(A) r5(A) w6(A) The number of schedules equal to given schedule(s) which not conflict equal to schedule(s) are _______.