cs gate paper 2006
TRANSCRIPT
-
8/14/2019 Cs Gate Paper 2006
1/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 1 of 29
( ) = + + +
! "! #
! $
%! &
'(' = )*+
!
"!
!
+
%!
{ },-.& / 0
)1
! 2
"!
!
%! .
# 3/
( ) ( ) < > 3
! 456+73
"!566
! 6
%! +73
, 8/2525!9
9'!25/1
! +: "!%:
!5:/
%!':/7
$ 5;97 $
-
8/14/2019 Cs Gate Paper 2006
2/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 2 of 29
/ / //1%=(
!
"!
! %! #
- //
>
+
/ ( ) //
! >
! +
! +
0 99/1
! !!
"! !!
! !!
%! 4
. ? / / : ,@ /
///:) / / : % 9! .A1
!
"!
-
8/14/2019 Cs Gate Paper 2006
3/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 3 of 29
!
%!
& 5; #9 / !
)///!1 ! #
"! ,
! $
%! -
2=/
! ( )
"! ( )/
! ( )//
%! ( )
// = { }
// ( ) 9 //
0
!
"!
!
%!
%B:C///
! D
-
8/14/2019 Cs Gate Paper 2006
4/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 4 of 29
"! E:
!
-
8/14/2019 Cs Gate Paper 2006
5/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 5 of 29
- F/ /F/
! E//
"! E//
!E/7 ( )/
%! E ( )
. ) / { }
= =
/
= =
!
"!
!
%!
& ' { } { } ! ! ! ! ! ! !+ + += =
{ } ! ! ! !+ + += )//46=1
!
"!
!
%!
//7 :
// ,@
"JJ
NJJ
#
, $ "JJ,
-
EB/-) 1
! )/$",
"! )/$"/
-
8/14/2019 Cs Gate Paper 2006
6/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 6 of 29
! )/
%!)
8 (
/ =
!
#
"!
!
%!
'+80
' ( ) ( ) ( )( ) ( ) = =
)/1
!
"!
! =
%!
= E " "= = ) /1
! %(
"!#"
! =
%!
# 0 { }$ =
% $ & $ O 4 4
( )( ) ( )( ) % & = ( ) /
-
8/14/2019 Cs Gate Paper 2006
7/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 7 of 29
/ ( ) //
1
! ( ) % & % &
"! ( ) % & +
! O% &
% &
%!
% &% &
, ' { } ! != > ' E (
% ( )
( ) { } =
( )
!
=
! !
"!
! ! +
%! +
$ ) / =/+/1
/:/
! ( ) ( )( ) ( ) ( )( ) ( ){ }/ / :
"! ( ) ( )( ) ( ) ( )( ) ( ){ }/ / :
! ( ) ( )( ) ( ) ( ) ( )( ){ }/ : /
%! ( ) ( )( ) ( ) ( )( ) ( ){ }/ / :
- /
( )( )) ( ) ( )( )
( )( )) ( ) ( )( )
' % & ( % ( & (
' % & ( % ( & (
)/1
! 5/5
"! 5/5
! 55/
%!"55/
-
8/14/2019 Cs Gate Paper 2006
8/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 8 of 29
. /
" % &
8
8 8
8 8
' P / 46! /
)/7 1% &
! ( )P % &
"! ( )P P% &
! ( )P P P% &
%! ( )P P % &
& 2 ) / ( )>
+ ( ) ) C
( )) ) C ) )///
/1
! ( ) ( ){ } > 9/ ) )= +
"! ( ) ( ) ( )
{ }
> = ) ) ) ) ) = +
! ( ) ( ) ( ){ } > # ) ) )= +
%! ( ) ( ) ( ){ } > - , ) ) )= + = =
8 ( ) > + ( ) ) ) / ( ) , = !
' ( ) ( ) ( ){ } > , - # ) ) )= + =
)/1
!'
"! '=9
! '=9/
%! '/
' E
-
8/14/2019 Cs Gate Paper 2006
9/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 9 of 29
! "%
-
8/14/2019 Cs Gate Paper 2006
10/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 10 of 29
) /
( ) 1
! + +
"! + +
! + +
%! + +
$ 0
" " "
/
!
" " " " " " " " " " " "+ + + + + +
"!
" " " " " " " " " " " "+ + + + + +
! ( ) ( ) ( )( ) " " " " "+ + + + +
%! " " " " " " " " " " " "+ + + + + +
- / +=963%9 ((!
/ QR :
/ / /
!
"!
!
%!
. " ( ) 0 =
/ 2
0 = 0 = :
/
( ) = /
D % D % D %
,
777
-
8/14/2019 Cs Gate Paper 2006
11/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 11 of 29
' ( ) ( ) , -, 0 = )/ 71
! 0 0 0
"! 0 0 0
! 0 0
%! 0 0 0 0
& ) C
" " "
//
9 ,
)/1
! ( ) , "
"! " "
+
!
,
%!
"
# #9/'
1 1 1 1 /
2 2 2 2 /
( ) + ( )$ ) /
1
! ( ) ( ) $#,2 1 1 1 1 =
"! ( ) ( ) #,2 1 1 1 1 = ! ( ) ( ) #,$-,2 1 1 1 1 =
%! ( ) ( ) $-2 1 1 1 1 =
# 5;:($# : : / : :9 : :(: :/ / : + 7
/: : )
:.2 # = = / :/(
! &
"! #
! -
-
8/14/2019 Cs Gate Paper 2006
12/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 12 of 29
%! .#
# 5; 9/ 0
-
8/14/2019 Cs Gate Paper 2006
13/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 13 of 29
! :
"! : :
! : :
%!:
#$ E // &:E"/ /(!/9:9/: 2,: /:"/! ://"1
!
"! #
! $
%! .
#- //
) / 7 / //S:C/1
! ( ) ( ) ( ) ( ) ( ) " " +
"! ( ) ( ) ( ) ( ) ( ) " " +
! ( ) ( ) ( ) ( ) ( ) " " +
%! ( ) ( ) ( ) ( ) ( ) " " +
$
#
#
,
-
-
8/14/2019 Cs Gate Paper 2006
14/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 14 of 29
#. '4 /0T
4 / 0
/1
! ==0B 0
"! ==0 0
! =0/
%!=0/ /0
#& 7D/:EE/
void insert (Q, x) {
push (S1, x);
}
void delete (Q) {
if (stack-empty(S2)) then
if (stack-empty(S1)) then {
print(Q is empty);
return;
}
else while (!(stack-empty(S1))){
x=pop(S1);
push(S2,x);
}
x=pop(S2);
}
' insert( )
! delete
7 D ' pushpop
)/ 1!
! ! ! !+ < +
"! ! ! + <
! ! ! ! < +
%! ! ! <
, F
=
// ( "(
algorithm zzz(x[ ], y[ ], z [ ] ) {
int i;
-
8/14/2019 Cs Gate Paper 2006
15/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 15 of 29
for(i=0;i
-
8/14/2019 Cs Gate Paper 2006
16/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 16 of 29
) / ! ! 1
! ! " < = + < =
! ! " ! !< = + =
! ! "! !
! !!
%! !!
,# 0
" "
//( )
" " "+ ++ + + = + + +
! : ( ) ( ) /
"! : ( ) ( ) , :
! : ( )
%! : ( )
,, EE
E work1work2/
/work2
/work1
Ework1/work2
5;!:work1
! EE
"! EE
! EE
%! EE
int work1(int *a, int i, int j) int work2(int *a, int i, int j)
{ {
int x = a[i+2]; int t1 = i+2;
a[j] = x+1; int t2 = a[t1];
return a[i+2] 3; a[j] = t2+1;
} return t2 3;
}
-
8/14/2019 Cs Gate Paper 2006
17/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 17 of 29
,$ / 99 // : 86334
subroutine swap(ix,iy)
it = ix
L1 : ix = iy
L2 : iy = it
end
ia = 3
ib = 8
call swap (ia, 1b+5)
print *, ia, ib
end
E/ (
E6=/'
E6=/'
E#/.
E,/9
+=/!
! EE
"! EE#
! E %! EE,
,- /
>=>!V
>=J>=9>K
>J>=I>K
>=J>9>=K
U
E/
E////
E / /
-
8/14/2019 Cs Gate Paper 2006
18/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 18 of 29
E#
E,/
! E
"! EE
! EE#
%! EE,
,. //
>
2 N /
W- -
! { } { } "! { } { }
! { } { } >
%! { } { }
,& /
( ){ }
( ){ }( ) ( ){ }
> X>X K
XIX K K
+
# X+
! > #+
"! > #+
! > # +
%! #I>
$ //
for (i 0, i
-
8/14/2019 Cs Gate Paper 2006
19/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 19 of 29
}
}
}
)/1
!
"! 9=
!/
%!
$ +,155)+, =
==//
=/5 T
void P (binary_semaphore *s) {
unsigned y;
unsigned *x = &(s->value);
do {
fetch-and-set x, y;
} while (y);
}
void V (binary_semaphore *s) {
S->value = 0;
}
)/1
! :=/5
"! 2/+,156)+,M
! T/
%!
$ 5; /9 /(#S"
:9'"!./ #9('"/
!
"!
! ,
%!
$ 9 9
E (
// / )/1
! +9/
-
8/14/2019 Cs Gate Paper 2006
20/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 20 of 29
"! /(
!
-
8/14/2019 Cs Gate Paper 2006
21/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 21 of 29
: : : = / /::/
"!
D "
YJ"
/
I"!
D "
Y"
/
DD
DD
"DD
DD
# 4DD
, //:7:/ ///:/6%"
)1
! ,
"!
! # %! ,
$. !!
: ! :/:/ 0/7
D!
D!
D++5+J5
D#= >J!
)/1
! 7
"! DD#= DD
! =D D
-
8/14/2019 Cs Gate Paper 2006
22/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 22 of 29
%!=D#/
$& !!
: !
:/:/ $ - .&
@755/! Q:=R
:::#:N"M:/
/ : Z ) / 1
!55
"! 5
! 8=J,5=5
%!8=J&52=5
- //
%& ( % ( %
)/1
! { } { }( %(+
=
"! { } { }& %&(+
=
! { } { } % %(+
=
%! { } { } %& %&(+
=
5=
E7L=
2=B
5B
5=
E7
2=B
EL=
5B
-
8/14/2019 Cs Gate Paper 2006
23/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 23 of 29
!
"#!
/0( $ 0B/=
- /(0
!
"!
! +
%!
- =/=0
!
"!
!
%!
- 0
!
"! +
!
%!
"$!
/(S"99
: ( ( (
99=$9
/(
1
1
-# 1
! #
"!
! .
%! -
-,
1
! #
-
8/14/2019 Cs Gate Paper 2006
24/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 24 of 29
"!
! .
%! -
%&!'(
)"%&'*!
9=:=
9GH=/GH
GH/G#H = 9 / /=GH/
-$ ) / 7 /9=1
! ,$.&
"! &$.,
! &$.,
%! &,$.
-- E-#9
=7D-$)/ 7/1
! -&.,$#
"! &.-$,#
! ,-$.
%!.$&-#,
)"%&(*+!
"((/
'E 5 T /
void barrier (void) {
-
8/14/2019 Cs Gate Paper 2006
25/29
-
8/14/2019 Cs Gate Paper 2006
26/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 26 of 29
P2: for (i=0; i
-
8/14/2019 Cs Gate Paper 2006
27/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 27 of 29
. 8/'4// //1
! "",""#"
"! """,""#
! "","""#
%! """#","
. / 7'
-
8/14/2019 Cs Gate Paper 2006
28/29
ECTest ID: 00www.gateforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 28 of 29
-
8/14/2019 Cs Gate Paper 2006
29/29
ECTest ID: 00www.gateforum.com