CS 2012: Set A, Question 0

To discuss a Question: Post "Pattern ID, Question Number", so that the students can understand your question

How was the paper?

Tough
8
17%
Moderate
28
58%
Easy
12
25%
 
Total votes : 48

Re: CS 2012: Set A, Question 0

Postby t4tarGATE » Mon Feb 13, 2012 3:18 pm

Priyankadevesh wrote:Wats d ans of IP address distribution.mine B but given ans A.

answer will be A.
t4tarGATE
Gatementor Regular
Gatementor Regular
 
Posts: 217
Joined: Wed Sep 07, 2011 4:27 am
My College/Company:: none
Roll Number: 0

Re: CS 2012: Set A, Question 0

Postby t4tarGATE » Mon Feb 13, 2012 3:20 pm

t4tarGATE wrote:q34-whats the answer for merge sort problem for lexicographic order sorting?? i think O(n log n)... but given answer is O(n^2)...!! what say ?

can any body clear it??
t4tarGATE
Gatementor Regular
Gatementor Regular
 
Posts: 217
Joined: Wed Sep 07, 2011 4:27 am
My College/Company:: none
Roll Number: 0

Re: CS 2012: Set A, Question 0

Postby targate2012 » Mon Feb 13, 2012 3:23 pm

t4tarGATE wrote:
t4tarGATE wrote:q34-whats the answer for merge sort problem for lexicographic order sorting?? i think O(n log n)... but given answer is O(n^2)...!! what say ?
can any body clear it??


The recurrence relation will be T(n) = 2T(n/2) + n^2
2T(n/2) - for division of the array into subarrays
n^2 - for merging of strings (in case of integers it was just 'n')

Solving this will give theta(n^2) and can be interpreted as O(n^2)
targate2012
 
Posts: 95
Joined: Sun Jan 15, 2012 4:35 pm
My College/Company:: nowhere
Roll Number: 9999999

Re: CS 2012: Set A, Question 0

Postby Priyankadevesh » Mon Feb 13, 2012 3:27 pm

@t4targate
can u explain why A in IP address distribution.m quite sure about it .it must b B.
Priyankadevesh
Gatementor Resident
Gatementor Resident
 
Posts: 306
Joined: Sun Jan 01, 2012 9:42 am
My College/Company:: No
Roll Number: 32120028

Re: CS 2012: Set A, Question 0

Postby targate2012 » Mon Feb 13, 2012 3:30 pm

Priyankadevesh wrote:@t4targate
can u explain why A in IP address distribution.m quite sure about it .it must b B.


Even I have this doubt, what is the logic behind choosing (a) over (b) ? Can anyone please explain ?
Is it because there will be duplicate IP addresses between org A and B ? But in that case, the subnets are different.
targate2012
 
Posts: 95
Joined: Sun Jan 15, 2012 4:35 pm
My College/Company:: nowhere
Roll Number: 9999999

Re: CS 2012: Set A, Question 0

Postby snarayana1417 » Mon Feb 13, 2012 3:41 pm

I FIND THIS PAPER TO BE THE PAPER WITH MOST NO. OF CONTROVERSIAL QUESTIONS. MANY QUESTIONS HAVE WRONG OPTIONS
snarayana1417
 
Posts: 6
Joined: Sat Sep 11, 2010 10:55 pm
My College/Company:: time
Roll Number: 99999

Re: CS 2012: Set A, Question 0

Postby Priyankadevesh » Mon Feb 13, 2012 3:46 pm

It is B.for option A to b valid its address shud b
245.248.136.0/20 but given is 245.248.136.0/21 for addresses to org A.
Priyankadevesh
Gatementor Resident
Gatementor Resident
 
Posts: 306
Joined: Sun Jan 01, 2012 9:42 am
My College/Company:: No
Roll Number: 32120028

Re: CS 2012: Set A, Question 0

Postby Priyankadevesh » Mon Feb 13, 2012 3:52 pm

Yes...some questions are having wrong option .like cpu scheduling,fetch and add.
For fetch and add question each option is wrong,somewhat B seems to b true,but nt exactly.it shud b lik this:fails as L can take on a non zero value when lock is nt available,bt given is lock is available
Priyankadevesh
Gatementor Resident
Gatementor Resident
 
Posts: 306
Joined: Sun Jan 01, 2012 9:42 am
My College/Company:: No
Roll Number: 32120028

Re: CS 2012: Set A, Question 0

Postby targate2012 » Mon Feb 13, 2012 3:58 pm

Priyankadevesh wrote:Yes...some questions are having wrong option .like cpu scheduling,fetch and add.
For fetch and add question each option is wrong,somewhat B seems to b true,but nt exactly.it shud b lik this:fails as L can take on a non zero value when lock is nt available,bt given is lock is available


CPU scheduling looks wrong when we do not take into account of ready queue.
If we take into account of ready queue and the order in which processes enter ready queue and what is available at the front of the queue, we get the right answer as P1 -> P3 -> P2
Gantt chart will be,
P1 - P2 - P1 - P3 - P2 - P1 - P3 - P2 - P2
targate2012
 
Posts: 95
Joined: Sun Jan 15, 2012 4:35 pm
My College/Company:: nowhere
Roll Number: 9999999

Re: CS 2012: Set A, Question 0

Postby sameer2009 » Mon Feb 13, 2012 4:53 pm

targate2012 wrote:
t4tarGATE wrote:
t4tarGATE wrote:q34-whats the answer for merge sort problem for lexicographic order sorting?? i think O(n log n)... but given answer is O(n^2)...!! what say ?
can any body clear it??

The recurrence relation will be T(n) = 2T(n/2) + n^2
2T(n/2) - for division of the array into subarrays
n^2 - for merging of strings (in case of integers it was just 'n')
Solving this will give theta(n^2) and can be interpreted as O(n^2)


consder two string
n = 4
say any string x = abcd ...x[0]=a, x[1]=b, x[2]=c, x[3]=d
[method 1]
now perform comparison @ indexes [0] using merge-sort time=O(nlogn)
now perform comparison @ indexes [1] using merge-sort time=O(nlogn)
now perform comparison @ indexes [2] using merge-sort time=O(nlogn)
now perform comparison @ indexes [3] using merge-sort time=O(nlogn)
so total n time so n * nlogn = n^2logn

[method 2]
level 1.......n
level 2.......n\2, n\2
level 3.......n\4 n\4 n\4 n\4
level 4.......
level 5......
level log n

and merging takes n^2
so total level * n^2 ........ = n^2logn
Check this out!!! Free Android App for Computer Science and Engineering Exam.
Download .apk file @ tinyurl.com/csexamapp
See How To Use @ tinyurl.com/csexamapplication
sameer2009
Gatementor Guru
Gatementor Guru
 
Posts: 1433
Joined: Tue Sep 09, 2008 5:29 pm
My College/Company:: lt
Roll Number: 99999

PreviousNext

Return to Discuss Computer Science Paper of GATE 2012

Who is online

Users browsing this forum: No registered users and 4 guests
cron