Você está na página 1de 5

www.gradeup.

co

Solutions

1. Ans. B. 6. Ans. A.
~  p  q  ~ r  v ~ s   # has the property of xor operation.
So x#y = xy’+x’y
~ p  q  ~ r  ~ s 
~ p  q  r  s  7. Ans. D.
1111 1111 1111 0101
~ ~ p  q  r  s  2’s complement 0000 0000 0000 1011
 p ~ q  r  s  11 and 1st bit is 1.
So result is -11
For x  11 only the above compound preposition is true.
8. Ans. C.
2. Ans. B.
0->1->0->2->0->3
Case I First bit is ‘0’
0000->0001->0100->0010->1000->0011
There are 6 states and 3 of them correspond to same
state.
To differentiate between 0,1,2,3 we need 2 bits.
To differentiate between 3 0's we need 2 bits.
So Total 4 bits required =4 FF

Case II First bit is ‘1’ 9. Ans. C.


Memory size  4 GB  232bytes
Word size = 2 bytes
∴ No. of Address bits
Memory size 232bytes
   23t  31 bits
Word size 2 bytes

 an  an  1  an  2 10. Ans. A.
Both ENQUEUE and DEQUEUE can be performed in O(1)
time using circular array.
3. Ans. B.
sin  x  4 11. Ans. D.
lim
x 4 x4 abcdef
sin  x  4  adebcf
 lim abdcef
x  4 0 x4
adbcef
sin y
 lim
x y y
By taking y  x  4  abdecf
adbecf
1
12. Ans. D.
4. Ans. A. Here function f takes two arguments one is int and the
1 other is short and its return type is void. So, in main
f x  x  a, 1 function ‘P’ is a pointer to short and when we call f (i,*p)
Given x2
there won’t be any type checking error.
 0 other wise
'
We know that  f  x  dx  1
a
13. Ans. D.
1 Merge sort  n log n in all the cases
1 '  1 
 
a x2
dx  1    1
 x a Quick sort  n log n best case and  n2   worst cases
1
 1  1  
Insertion sort  n best case R  n 2
worst case
a
 a  0.5 14. Ans. A.

5. Ans. B.
Given that 2  1 and 3 are two Eigen values of 3  3
real matrix is, 2  i and 3 are Eigen values.
But 2-i also Eigen values (complex roots occurs in pair
only)
det = Product of Eigen values
 2  i  2  i  3  5  3  15

1|Page
www.gradeup.co

MST of G does not change but shortest path between


 
3
 x9 1  x  x2  ...
some pair may change when every edge weight is

 
3
increased by same value as shown in above.
 x9 1  x 
1

15. Ans. B.  x9 1  x 
3

Output is not affected by the function mystery () as it is


just taking the address of a&b into ptra & ptrb and
 x9 

n  1 n  2 xn
contents of ptra & ptrb are swapped leaving a&b as it is. n0 2
45
16. Ans. D. For coefficient of x12 put n  3   10
Given grammar generates all strings of a’s and b’s 2
including null string
27. Ans. B.
L   a  b *
The recurrence relation can be written as
an  an  1  6n2  2n …(i)
17. Ans. C.
There is no known algorithm to check whether the Characteristic equation is m  1  0,m  1
language accepted by TM is empty. Similarly there is no Complementary solution  an1  C1 1  C1
n

algorithm to check whether language CFG’s are


equivalent. 
Let the particular solution be an   An2  Bn  c n …(2)
b

( RHS is second deg ree polynomial and 1is root)
18. Ans. B.
A) contains 00 & 11 consecutively which is not the  
By substuting an  An2  Bn  C n in (1) and solving
required condition. A  2,B  4,C  2
C) Doesn’t guaranty that both 00 & 11 will be present in
the string.
General solution is an  an   an   C1 
c b
2n
2

 4n  2 n
D) Says string should start with 11 & ends with 00 or vice given a1  B  B  c1  B  c1  0
versa.
Given a99  k  104

 2  99   4  99   2 99  2
2
19. Ans. A.
x1 = u - t;  
y1 = x1 * v; 100  12  2 100  1  100  1   104
x2 = y1 + w;  
y2 = t - z; 198  K  104
y3 = x * y2; K  198
So, we require total 10 variables in SSA form of the given
code. 28. Ans. A.
n
20. Ans. A. Given f n  f   is n is even
SRTF is pre-emptive SJF which produces less average 2
waiting time.  f n  5 if n is odd
We can observe that
21. Ans. B.
Any superset of VY is a super key. f 1  f 2  f 3  f  4  f 6   f 7 ..... and
f 5  f 10  f 15  .............
22. Ans. D.
‘D’ means durability not deadlock freedom. Clearly, the range of f(x) will contain two distinct
elements only.
23. Ans. A.
candidate key is (volume, number, start page, end page) 29. Ans. A.
(Volume number) → year is a partial dependency. So From the given steps we can observe that probabilities of
original table is in 1NF but not in 2NF y are
2
1 11 1 1
,   ,  ,.......
24. Ans. C. 4 44 4 4
Except DHCP, remaining all the protocols are used to Required probability
resolve one form of address to another one.
1  1 1   1  1
2

            ....
25. Ans. C. 4  4 4    4  4 
FTP and POP 3are stateful application layer protocols 2 3
1 1 1
        ...
26. Ans. A. 4 4 4
x 
3
3
 x 4  x5  x6  ...

2|Page
www.gradeup.co

1 1 1
2
 38. Ans. A.
 1      ...
4  4 4 

 
1 1  1 4 1
       0.33
4 1 4 3 3
 1  
 4

30. Ans. D. If x  12 then the shortest path between d & c will


contain edge with lable ‘x’.
Output of first multiplexer is Y1  P0  PR  PR
Output of second multiplexer is 39. Ans. D.
X  QR  QY1  QR  QPR  QR  PQR

31. Ans. B.
DMA controller needs
29154kB
 16  455.53125  456
2 byte

32. Ans. B. 40. Ans. B.


Old design tp  800 Statement II is correct. If e is the heaviest edge in cycle
every mst excludes it.
New design tp  600 Statement 1 is incorrect. Complete graph with 4 vertices
800  600 and edge weights 1,2,5,6 in non diagonal and diagonal
Throughput   100%  33.33% edges 3 and 4. 4,5,6 will create a cycle and we can
600
exclude the lighest edge e (4) from it, in a MST. So every
MST of G need not include e.
33. Ans. B.
Look ahead carry generator gives output in constant time
41. Ans. B.
if fan in = number of inputs.
Exp. Maximum number of iterations will be
If we have 8 inputs, and OR gate with 2 inputs, to build
an OR gate with 8 inputs, we will need 4 gates in level-1, n2  256  n  16
2 in level-2 and 1 in level-3. Hence 3 gate delays, for
each level. 42. Ans. D.
Similarly an n-input gate constructed with 2-input gates, Lagrange’s generated by G1  a * b 
total delay will be O(log n).
Lagrange’s generated by G2  ab*  b
34. Ans. D.
When a=b then P[a] will have the maximum value of the 43. Ans. D.
array. Given PDA can accept any number of a’s by staying at
initial state. This PDA can also accept the strings a’s
35. Ans. A. followed by b’s but equal number of a’s and b’s by
reaching other final state. So
   
L  an | n  0  an bn | n  0 and is deterministic context-
free.

44. Ans. C.
Y reduces to W and we know Y is Recursively enumerable
but not recursive, so W is not recursively enumerable.
Z reduces to X and we know X is recursive language,
then Z is also recursive language.

45. Ans. C.
2  5 1  7*3
2   5  1  7 * 3
Output is 3 1 2 2 1 3 4 4 4
2  6  7*3
36. Ans. D. 2  6  7 * 3
Dynamic scoping looks for the definition of free variable
2   1 * 3
in the reverse order of calling sequence.
2  1 * 3
37. Ans. B.
3*3  9
Time complexity of heapification is O (height) = O(d)

3|Page
www.gradeup.co

46. Ans. C.

For first a1 to a20 20 fault


Next a1 to a9 Hit
47. Ans. A. again a10 to a19 replace any location from 0 to 9 for a20
Given LA  40 bit  LAS  240 Hit.
Page size = 16 KB So total 30 page fault
Page table Entry size (e) = 48 bits (or) 6 bytes Difference = 31 − 30 = 1
Page table size = ?
Size of the page table  n  e 50. Ans. A.
LAS 240 It can guarantee that at most one process can be in
∴ No. of pages (n)   14  226  64M critical section at any time. But other conditions will fail in
PS 2
some cases.
∴ Page table size  64  6B  384MB
51. Ans. A.
48. Ans. A. 2PL ensures serializability and here as we are following
C-Look disc Scheduling linear order in acquiring the locks there will not be any
0 10 11 38 47 63 87 92 121 191 199 deadlock.

52. Ans. B.

∴ Total Head movements


 24  5  29  70  181  1  27  9  346

49. Ans. B.
a1, a2 ,....a20 , a1, a2 ,......a20

53. Ans. B.

So, no. of fragments that are transferred in this scenario


is 13.

54. Ans. B.
For first a1 to a20 20 page fault Given
C  1 Mb
Now a1 to a9 Hit
Max Output rate = 20 Mbps
again a10 to a20 replace only 9th position, so 11 page Arrival rate = 10 Mbps
fault. ∴ The minimum time required to transmit the data is
So total 31 page fault c
S
mp

4|Page
www.gradeup.co

1Mb 1 ∴ Channel Utilization


S   0.1sec
20  10Mpbs 10 Tn 100ms
 
For 12Mb of data, S value becomes 1.2 seconds Tn  Tack  2Tp 100ms  100ms  200ms
1
55. Ans. B. 
4
Frame size (L) =1000bytes
∴ Throughput
Sender side bandwidth (BS) = 80kbps
Acknowledgement (LA) =100bytes 1
   B   10  103  2.5Kbps
Receiver side bandwidth (BR) =8kbps 4
Tp  100 ms  or 2500Bps 
Tx
n
Tx  Tack  2Tp
L 1000Bytes
msg Tx  
BS 10  103 BPS
 100 ms

LA 100 Bytes
 Ack  TA  
BR 1  103 BPS
 100 ms

Tp  100 ms

***

5|Page

Você também pode gostar