About

I am too Lazy to update about me.

Role

Alma Mater:

Not updated.

Experience:

Not updated.
Babytud
Multichoice
8 months 6 hours ago

C is even more strong...

moreless
Babytud
Answer
8 months 1 week ago

240.... as static variables do have only one copy ,thus while in the process of returning from the topmost activation record of the stack to the lower records the value of variabe is going to be changed and the most recent value will be seen by every remaining record in the recursion stack...

moreless
Babytud
Multichoice
8 months 2 weeks ago

T(n) represents number of steps taken in order to cross "n" inches
T(n)= 1 + T(n-1) ; // Since at the bottom probability of getting closer is 1.
T(n-1) = 1/3(1+ T(n-2)) + 2/3(1 + T(n)); // since now probability of getting closer is 1/3 and away is 2/3.
Substituting T(n); we get'
T(n-1) = 5/3 + (T(n-2))/3 + 2/3(T(n-1)); 
=> T(n-1)= 5 + T(n-2);
Back substituting T(n-1) into T(n) , we get,
T(n)= T(n-2) + 5 +1;
Similarly,
T(n-2) = 1/3(1+T(n-3)) + 2/3(1 + T(n-1));
Substituting value of T(n-1),we get,
T(n-2)= 13 + T(n-3);
Back substituting T(n-2) in T(n), we get,
T(n) = T(n-3) + 13 + 5 + 1;
Similarly 
T(n) = T(n-4) + 29 + 13 + 5 +1
If we make a observation then, above equation can be re-written as 
T(n)= T(n-4) + (2^(4+1)-3) + (2^4-3) + (2^3-3) + (2^2-3);
OR
T(n)= T(n-4) +(2^(4+1)) + (2^4) + (2^3) + (2^2) - 4*3
Generalizing above recurrence now, we get,
T(n) = T(n-k) + (2^(k+1)) + (2^k) + (2^(k-1)) +-----------+(2^3) + (2^2) - k*3
Adding 3 and subtracting 3 to make it a complete GP, we get,
T(n) = T(n-k) + (2^(k+1)) + (2^k) + (2^(k-1)) +-----------+(2^3) + (2^2) +(2^1)+(2^0) -3- k*3
Solving GP,we get,
T(n) = T(n-k) + 2^(k+2) -1 -3(1+k);
Now we use anchor condition; which is T(0)=0 , obviously.
putting n-k = 0,we get
T(n)= T(0) + 2^(n+2) - 3(1+n) - 1 ;  since n-k=0 => n=k;
Thus T(n) = 2^(n+2) -4 - 3n 
Or  T(n) = 4.2^n - 4 -3n => T(n) = 4(2^n-1) - 3n.
Thus answer is exponential to n.

 

moreless
Babytud
Short answer
8 months 2 weeks ago

Try to formulate the recursive equations then it may be easier. 
Like

T(a,b)= 0 ; where (a<0 || b<0)
T(a,b)= b+1 ; where (a==0)
T(a,b)= T(a-1,b) ; where (b==0)
T(a,b)=T(a-1,T(a,b-1)) : otherwise
Then try to evaluate.

moreless
Babytud
Short answer
8 months 2 weeks ago

WOW..

T(3,1) = T(2,T(3,0))
T(3,0) = T(2,1) = T(1,T(2,0))
T(2,0)= T(1,1) = T(0,T(1,0))  = T(0,2) = 3 (since T(1,0)=T(0,1)=2)
Now,  T(3,0)= T(2,1)=T(1,3) = 5
Therefore, T(3,1)= T(2,5)
T(2,5)=T(1,T(2,4))
T(2,4)=T(1,T(2,3))
T(2,3)=T(1,T(2,2))
T(2,2)=T(1,T(2,1))= T(1,5). There is a pattern which I got while solving which is value of T(1,x)= x+2 i.e T(1,0)=0+2=2, T(1,3) = 3+2 =5
Using this..T(2,2)= T(1,5)=5+2=7
T(2,3)=T(1,7)=9 and T(2,4)=T(1,9)=11 and T(2,5)=T(1,11) = 13
Since T(3,1)= T(2,5)
Therefore, T(3,1)=13

moreless
rbrgate's picture
Ravindra Babu Ravula
sumitverma's picture
Sumit Verma
pritam's picture
Pritam Prasun
pritam's picture
Pritam Prasun
905
sumitverma's picture
Sumit Verma
10677
mayank trivedi
37137
Nirmala
37256
12 Nov 2017 - 10:14am

240.... as static variables do have only one copy ,thus while in the process of returning from the topmost activation record of the stack to the lower records the value of variabe is going to be changed and the most recent value will be seen by every remaining record in the recursion stack...

more less
2 Nov 2017 - 5:17am

Minimum might be 1.
If for example there is a router which is just acting as a boundary to network and not forwarding any packets to other network then in that case minimum of 1 interface is required for a router.

For ex:

A------B------C-------D-------E------ so on... 

here for A only ONE interface is required as only connected to one N/W. 

more less
29 Oct 2017 - 8:51am

Question is about suitable linked list that can be used...

If we observe closely than we will find that with singly linked list if we try to implement queue then we need two external pointers(front and rear), front for dequeue and rear for enqueue... and also we are wasting the last node's 'next' pointer as it is made NULL.

But if we use circular linked list then we can use the last node's pointer to point to the first node(vaguely calling it first as circular list ),thus efficient use of memory and unlike SLL we can use only one external pointer pointing to the last node and this way queue can be implemented ( try it by yourself to check its validity). 

So circular linked list will be more suitable(efficient) in terms of memory usage . Thus Circular Linked List must be the answer....

Source :- Tenenbaum ,DSUC 2nd edition pg no. 229  or GATE 2004 Question.

more less
26 Oct 2017 - 10:58am

Contruct the graph..

f(x)= 1 - ( -x )   ;  -1<= x < 0

=> f(x) = 1+x ; -1 <= x < 0 & f'(x) = 1

f(x) = 1- (x) ; 0<= x <= 1 & f'(x) = -1

Clearly x = 0 is a point of maxima. But in this case f'(x) does not exist at x=0 but there is a change in sign of derivative in its neighbourhood i.e f'(x) >0 for x = (0-h) and f'(x) < 0 for x = (0+h) , thus it must be the point of local maxima which in this case is a global maxima too.

So at x=0 maxima and maximum value is f(x) = 1 . 

more less
20 Oct 2017 - 6:33pm

You have to differentiate whether question asks for after how many RTTs the size will become so and so OR after how many RTTs we will be able to send the segment of so and so size completely. Accordingly calculate the time required.

Here for example:-  how long it wlll take to send full window size.

Th= 20 KB

Initially in Slow start phase..

2 | 4 | 8 | 16 | 20 | 22| 24 | ... which means after 6 RTTs we have the  window of size 24 KB but it is after 7 RTTs only that the window of 24KB will be sent completely. So answer would be 7 RTTs = 7* 2 * Tp = 7*20= 140 ms.

 

more less
20 Oct 2017 - 6:32pm

Oh.. yes it was a mistake ... I corrected it...  

Two answers possible coz of whether to consider the last RTT or not.. Even in 2014 IITs released two answers in their key. 

https://gateoverflow.in/1794/gate2014-1-27

more less
MTU is maximum transmissible unit or you can say that it is the payload of DLL frame excluding the head and the tail ( recall max MTU = 1500 bytes but max frame = 1518 bytes).... so here given MTU = 1460B which is nothing but the total size of the N/w layer datagram so after deducting the IP header we get segment(TCP packet) = 1440 B.. But MSS is maximum amount of data any TCP segment can hold, thus by that definition MSS must be 1440-20 = 1420 B. So MSS = 1420 B
more less
11 Oct 2017 - 10:01am

Prove it by mathematical induction.... 

more less

The new tab typically creates a new TCP connection to the server which means new process(or thread depends upon implementation) will be invoked ( new port numbers) .. for ex- if 1st tab is using port no. 54321 other tab will use different port no. ( say 54322).Thus server can uniquely identify a new tab.

more less

If we pivot the array at the mid-point then worst case is all the negative numbers are after the positive numbers. Now take two pointers one for the front and one for the rear.Every time you have to make a exchange and when front pointer exceeds rear we stop. So in worst case n/2 exchanges.

Ans:- (D)

more less

Pages