Log In

Recent activity by vijaycs

2 answers
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]$
commented Apr 18, 2017 in Algorithms 5k views
4 answers
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 ______.
commented Apr 5, 2017 in CO and Architecture 12.1k views
1 answer
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.
commented Apr 2, 2017 in Programming 618 views
4 answers
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
commented Mar 31, 2017 in Digital Logic 1.5k views
4 answers
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
commented Mar 31, 2017 in Set Theory & Algebra 1.9k views
1 answer
1. Does starvation freedom imply bounded- waiting ? 2. Does bounded- waiting imply starvation freedom ? Explain with example.
commented Mar 28, 2017 in Operating System 950 views
2 answers
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$
commented Mar 28, 2017 in Operating System 3.3k views
7 answers
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$
commented Mar 27, 2017 in Operating System 16.9k views
1 answer
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
commented Mar 26, 2017 in Algorithms 165 views
4 answers
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$
commented Feb 14, 2017 in Digital Logic 5.5k views
5 answers
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$
answer edited Feb 14, 2017 in Digital Logic 5.6k views
4 answers
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
commented Feb 9, 2017 in Databases 11.5k views
1 answer
Reply with solution @Arjun sir,@habibkhan,@vijaycs
answer selected Feb 7, 2017 in Algorithms 507 views
0 answers
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?
commented Feb 4, 2017 in DS 264 views
2 answers
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)$
commented Jan 31, 2017 in Linear Algebra 4.6k views
1 answer
What is the difference betwen 2s complent of a number and 2s complement representation of a number .
commented Jan 31, 2017 in Digital Logic 706 views
4 answers
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
commented Jan 31, 2017 in Others 5.2k views
2 answers
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
answer selected Jan 31, 2017 in Others 391 views
3 answers
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?
answer selected Jan 30, 2017 in DS 679 views
1 answer
#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 ?
commented Jan 29, 2017 in Algorithms 413 views
2 answers
0 answers
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.
commented Jan 28, 2017 in Databases 91 views
2 answers
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?
commented Jan 28, 2017 in Operating System 348 views
2 answers
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 _______.
commented Jan 28, 2017 in Databases 498 views
0 answers
3 answers
Consider languages L1 and L2 over {0,1) alphabet. L2= {w/w contains some x as a substring and x belongs to L1} Which of the following must be true? I. If L1 is regular, L2 is also regular II. If L1 is CFL, L2 is also CFL III. If L1 is recursive, L2 is also recursive (A). I and II only (B). I, II, III only (C). I and III only (D). II and III only
commented Jan 25, 2017 in Theory of Computation 550 views
1 answer
Consider the following C program segment: struct node What is the output of above C program when it runs on a root node of a binary tree? prints nodes at K distance from root node. print nodes of Kth level of binary tree. Both (a) and (b) None of these
commented Jan 25, 2017 in DS 368 views
3 answers
Maximum number of keys a B-Tree of order 5 and height 4 can have ? Note: An order P B-Tree can have at most P-1 keys in a node. (A) 2500 (B) 3905 (C) 3124 (D) 4500
answer selected Jan 25, 2017 in Databases 348 views
1 answer
answer selected Jan 25, 2017 in DS 147 views