# Recent activity by tusharp

1
When searching for the key value $60$ in a binary search tree, nodes containing the key values $10, 20, 40, 50, 70, 80, 90$ are traversed, not necessarily in the order given. How many different orders are possible in which these key values can occur on the search path from the root to the node containing the value $60$? $35$ $64$ $128$ $5040$
2
Consider the relation employee(name, sex, supervisorName) with name as the key, supervisorName gives the name of the supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce? ... with no immediate male subordinates. Names of employees with no immediate female subordinates. Names of employees with a female supervisor.
3
Which of the following is NOT a superkey in a relational schema with attributes $V,W,X,Y,Z$ and primary key $V\;Y$? $VXYZ$ $VWXZ$ $VWXY$ $VWXYZ$
4
A man has three cats. At least one is male. What is the probability that all three are male? $\frac{1}{2}$ $\frac{1}{7}$ $\frac{1}{8}$ $\frac{3}{8}$
5
Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus. {$t$ | $\exists$u $\in$ ... v[DeptId]))} Which of the above queries are safe? I and II only I and III only II and III only I, II and III
6
A random bit string of length n is constructed by tossing a fair coin n times and setting a bit to 0 or 1 depending on outcomes head and tail, respectively. The probability that two such randomly generated strings are not identical is: $\frac{1}{2^n}$ $1 - \frac{1}{n}$ $\frac{1}{n!}$ $1 - \frac{1}{2^n}$
7
A multiset is an unordered collection of elements where elements may repeat any number of times. The size of a multiset is the number of elements in it, counting repetitions. What is the number of multisets of size $4$ that can be constructed from n distinct elements so that at least one element occurs exactly twice? How many multisets can be constructed from n distinct elements?
8
How many ways can n books be placed on k distinguishable shelves if no two books are the same, and the positions of the books on the shelves matter?
9
Which of the following disk scheduling strategies is likely to give the best throughput? Farthest cylinder next Nearest cylinder next First come first served Elevator algorithm
10
Consider a selective repeat sliding window protocol that uses a frame size of $1$ $\text{KB}$ to send data on a $1.5$ $\text{Mbps}$ link with a one-way latency of $50$ $\text{msec}$. To achieve a link utilization of $60\%$, the minimum number of bits required to represent the sequence number field is ________.
11
Which of the following statements are TRUE? S1: TCP handles both congestion and flow control S2: UDP handles congestion but not flow control S3: Fast retransmit deals with congestion but not flow control S4: Slow start mechanism deals with both congestion and flow control $S1$, $S2$ and $S3$ only $S1$ and $S3$only $S3$and $S4$ only $S1$, $S3$ and $S4$ only
12
Host A (on TCP/IP v4 network A) sends an IP datagram D to host B (also on TCP/IP v4 network B). Assume that no error occurred during the transmission of D. When D reaches B, which of the following IP header field(s) may be different from that of the original datagram D? TTL Checksum Fragment ... only $\text{i}$ and $\text{ii}$ only $\text{ii}$ and $\text{iii}$ only $\text{i, ii}$ and $\text{iii}$
13
In a communication network, a packet of length $L$ bits takes link $L_1$ with a probability of $p_1$ or link $L_2$ with a probability of $p_2$. Link $L_1$ and $L_2$ have bit error probability of $b_1$ and $b_2$ ... $[1 - (b_1 + b_2)^L]p_1p_2$ $(1 - b_1)^L (1 - b_2)^Lp_1p_2$ $1 - (b_1^Lp_1 + b_2^Lp_2)$
14
The Boolean function in sum of products form where K-map is given below (figure) is _______
15
A Boolean function $f$ is to be realized only by $NOR$ gates. Its $K-map$ is given below: The realization is
16
Consider the sequential circuit shown in the figure, where both flip-flops used are positive edge-triggered D flip-flops. The number of states in the state transition diagram of this circuit that have a transition back to the same state on some value of "in" is ____
17
Consider the following combinational function block involving four Boolean variables $x,\:y,\:a,\:b$ where $x,\:a,\:b$ are inputs and $y$ is the output. f(x, a, b, y) { if(x is 1) y = a; else y = b; } Which one of the following digital logic blocks is the most suitable for implementing this function? Full adder Priority encoder Multiplexor Flip-flop
18
Consider the function $f$ defined below. struct item { int data; struct item * next; }; int f(struct item *p) { return ((p == NULL) || (p->next == NULL)|| ((p->data <= p ->next -> data) && f(p->next))); } For a given linked list ... in non-decreasing order of data value the elements in the list are sorted in non-increasing order of data value not all elements in the list have the same data value
19
A circularly linked list is used to represent a Queue. A single variable $p$ is used to access the Queue. To which node should $p$ point such that both the operations $\text{enQueue}$ and $\text{deQueue}$ can be performed in constant time? rear node front node not possible with a single pointer node next to front
20
21
What is the best case and worst case of the algorithm? And when will best case and worst case will happen?? int main() { for(i=1 ; i<=n ; i++) { if(n%i == 0) { for(j=1 ; j<=n ; j++) { printf("Hello"); } } } }
22
The regular expression 0*(10*)* denote the same set as (1) (1*0)*1* (2) 0+(0+10)* (3) (0+1)*10(0+1)* (4) None of these Isnot 1) as same as given expression?
23
A program attempts to generate as many permutations as possible of the string, '$abcd$' by pushing the characters $a, b, c, d$ in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings CANNOT be generated using this program? $abcd$ $dcba$ $cbad$ $cabd$
24
How many 5 letter word possible having atleast 2 a's ?
25
For a set $A$, the power set of $A$ is denoted by $2^{A}$. If $A = \left\{5,\left\{6\right\}, \left\{7\right\}\right\}$, which of the following options are TRUE? $\phi \in 2^{A}$ $\phi \subseteq 2^{A}$ $\left\{5,\left\{6\right\}\right\} \in 2^{A}$ $\left\{5,\left\{6\right\}\right\} \subseteq 2^{A}$ I and III only II and III only I, II and III only I, II and IV only
26
The number of ways in which the numbers $1, 2, 3, 4, 5, 6, 7$ can be inserted in an empty binary search tree, such that the resulting tree has height $6$, is _________. Note: The height of a tree with a single node is $0$.
A program $P$ reads in $500$ integers in the range $[0, 100]$ representing the scores of $500$ students. It then prints the frequency of each score above $50$. What would be the best way for $P$ to store the frequencies? An array of $50$ numbers An array of $100$ numbers An array of $500$ numbers A dynamically allocated array of $550$ numbers
Suppose the predicate $F(x, y, t)$ is used to represent the statement that person $x$ can fool person $y$ at time $t$. Which one of the statements below expresses best the meaning of the formula, $\qquad∀x∃y∃t(¬F(x,y,t))$ Everyone can fool some person at some time No one can fool everyone all the time Everyone cannot fool some person all the time No one can fool some person at some time
C program is given below: # include <stdio.h> int main () { int i, j; char a   = {{'a', 'b', 'c'}, {'d', 'e', 'f'}}; char b  ; char *p = *b; for (i = 0; i < 2; i++) { for (j = 0; j < 3; j++) { *(p + 2*j + i) = a [i] [j]; } } } What should be the ... $\text{e f}$ $\text{a d}$ $\text{b e}$ $\text{c f}$ $\text{a c}$ $\text{e b}$ $\text{d f}$ $\text{a e}$ $\text{d c}$ $\text{b f}$
Consider the following C program segment. # include <stdio.h> int main() { char s1 = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); } What will be printed by the program? $12$ $120400$ $1204$ $1034$