Comp SC Enginnering P2
Comp SC Enginnering P2
(
2. What will be the output of the
following code?
mar = arr[i];
#include<stdio.h>
int main() )
(
)
printf("%d", 1 << 2 + 3 << 4);
return 0; return max;
112 )
int main()
512
(
(a) 569
415
(C) 558
/20-A 2
5. What will be the output of following (8) a structure of 2 fields, each
code? field being a pointer to an array
of 10 elements
#include<stdio.h>
const int M = 3; (C) a structure of 3 fields: an
integer, a float and an a]Tay of
const int N = 3; 10 elements
void print(int arr[M][N])
(D) an array, each element of
( which is a structure of type
node
int i, j;
)
(A)3
(
(C) 25
int arr[][3] = {{1, 2, 3}, {4, 5, 6},
(7, 8, 9)); (D) 22
print(arr);
8. Assume that objects of the type
retu- 0; short, float and long occupy 2 bytes,
)
4 bytes and 8 bytes respectively.
The memory requirement for
(A) 123456789 variable t, ignoring alignment
struct (
(a) 2 5 8 9 6 3 7 5 6
(C) 148987889 short s [5];
(D) 1 1 1 1 1 1 1 1 1 union (
( long z;
int i;
float j;
)t
);
/20-A I P.T.O.
9. Consider the given three C 11. The output of the following C
functions : progran is
[Pll int * g (void)
void fl (int a, int b)
(
int x - 10; (
return (&x);
int c;
)
(
)
int * px;
*px - 10;
void f2(int *a, int *b)
return px;
(
)
)
(
l^rhich of the above three functions
are likely to cause problems? int a=4, b=5, c=6;
(A) Only Pl and P2
fl (a,b) ;
(a) Only P3
(C) Only Pl and P3 f2(&b, &c);
(D) P1, P2 and P3
printf("%d",c-a-b);
10. What does the given program print?
char c[ ] = "GATE2011" )
char *p - c;
(A) -5
printf("%s",p + p[3] -p[1]);
(a) 2011
(C) -6
(C) E2011
/20-A
12. The following program prints 14. The output of the following C
#include<stdio.h> program is
#include<stdio.h>
void i(int *p, int *q)
void mystery(int *ptra, int *ptrb)
(
(
P=q;
int *temp;
*p = 2;
temp = ptrb;
)
ptrb - ptra;
int i = 0, j -1;
ptra - temp;
int main()
)
( int main()
f(&i, &j);
(
printf("%d %d \n", i, j); int a=2016, b=0, c=4, d=42;
retu- 0; mystery(&a, &b);
) if (a < c)
(A) 2016
13. Consider the following C program
(a) 2018
void f(int, short);
(C) 016
void main()
(D) 16
(
int i = 100;
15. The most appropriate matching for
the following pairs
short s = 12;
X: m=malloc(5); m= NULL;
short *p = &s;
Y: free(n); nivalue = 5;
_., I I call to f() Z: char *p; *p=`a';
) 1 : using dangling
Which one of the following 2: using uninitialized pointers
expressions, when placed in the
blank above, will not result in a type 3: lost memory
checking error? is
(A) f(s,*s) (A) X~1 Y-3 Z-2
/20-A I P.T.O.
16. A queue follows 20. We can use a self-balancing binary
search tree for implementing the
(A) LIFO principle (A) hash table
(D) O(1ogn)
22. Suppose we have numbers between
1 and 1000 in a binary search tree
18. Which data structure do we use for and want to search for the number
testing a palindrome? 363. Which of the following
sequences cot(Zd not be the
sequence of the node examined?
(A) Heap
(A) 2, 252, 401, 398, 330, 344, 397,
(8) Tree 363
(a) 924, 220, 911, 244, 898, 258,
(C) Priority queue 362, 363
(a) 2h-1 + I
(C) (2,8), (2,5), (1,3)
(c) 2h-1
(D) (8,5), (8,3), (5,3) (D) 2h+ 1
/20-A
24. The Breadth First Search traversal 27. What is an internal sorting
of a graph will result into algorithm?
W= (D) B-tree
(a) 63
(C) 127
(D) 188
/20-A 7 I P.T.O.
31. Which of the following refers to the 34. After groups have been established,
degree (or arity) of relation in SQL applies predicates in the
relational database systems? clause, allowing aggregate
functions to be used.
(A) Number of attributes of its (A) Where
relation schema
(a) Having
(8) Number of tuples stored in the (C) Groupby
relation
(D) With
(C) Number of entries in the
relation 35. What is the function of the following
command?
(D) Number of distinct domains of
its relation schema Delete from R where P;
(A) Clears entries from relation
32. Which one of the following is used (8) Deletes relation
to represent the supporting many-
(C) Deletes particular tuple from
one relationships of a weak entity relation
set in an entity-relationship
diagram? (D) AIl of the above
(A) Diamonds with double/bold 36. The logical design and the snapshot
border of the data at a given instant in time
is known as
(a) Rectangles with double/bold
border (A) Instance and Relation
(8) Relation and Schema
(C) Ovals with double/bold border
(C) Domain and Schema
(D) Ovals that contain underlined (D) Schema and Instance
identifiers
37. For designing a normal RDBMS,
33. Given the basic ER and relational which of the following normal forms
models, which of the following is is considered adequate?
incoFTect?
(A) 4NF
/20-A
39. A unit of storage that can store one 43. Banker's algorithm is used
or more records in a hash file
organization is denoted as (A) to prevent deadlock
(8) to deadlock recovery
(A) buckets
(C) to solve the deadlock
(8) disk pages (D) None of the above
(C) blocks
44. What is the fence register used for?
(D) nodes
(A) Disk protection
40. A unit of storage that can store one (8) CPU protection
or more records in a hash file (C) Memory protection
organization is denoted as
(D) None of the above
(A) buckets
45. A process which is copied from main
(8) disk pages memory to secondary memory on
the basis of requirement is known
(C) blocks as
(D) nodes (A) demand paging
(a) segmentation
41. A counting semaphore was
(C) pagin8
initialized to 10. Then 6 P (wait)
operations and 4 V (signal) (D) threads
operations were completed on this
semaphore. The resulting value of 46. Which of the following scheduling
the semaphore is algorithms is preemptive
scheduling?
(A)0
(A) FCFS scheduling
(a)8
(8) SUF` scheduling
(C) 10 (C) Network scheduling
(D) 12 (D) SRTF scheduling
/20-A I P.T.O.
48. Consider the set of 5 processes 51. Which of the following are examples
(FCFS) whose arrival time and burst of stateful application layer
time are given below : protocols?
PI 3 4 (Zii) TCP
3 /!L,/ POP3
P2 5
(AL) (i) and (iv)
P3 0 2
(8) (it) and (iit)
P4 5 1
lc) (ii) and (iv)
P5 4 3
(D' (iit) tlnd (iv)
What is average waiting time?
52. Which one of the following uses
(A) 2.3 units UDP as the transport protocol?
(C) HITP
(D) 3.9 units
(D) DNS
49. UNIX is written in which language?
53. Protocol where each frame begins
(A) C++ with at least two SYN characters is
(C) C#
(a) BISYNC
(C) DHCP
(D) .NET
(D) SMTP
50. A system program that combines
the separately compiled modules of 54. An organization has a class 8
a program into a form suitable for network and wishes to form subnets
execution is known as for 64 departments. The subnet
mask would be
(A) assembler
(A) 255.255.0.0
(8) linking loader
(8) 255.255.64.0
(C) cross compiler (C) 255.255.128.0
/20-A 10
55. Choose the best match between 57. Error detection at data link layer
Group-1 and Group-2 is achieved by
(A) switch
56. What is split horizon?
(a) hub
(A) Information about a route
should not be sent back in the
(C) router
direction from which the
original update came
(D) modem
/20-A 11 I P.T-O.
61.Why is the complexity of 64. Which of the following is the
Bresenham's line drawing purpose of the error term in the
algorithm less than that of DDA line DDA algorithm?
drawing algorithm?
(A) To ensure that the line is drawn
(A) It uses floating point operations correctly
over integer addition and
subtraction (8) To improve the accuracy of the
line
(8) It considers only selected
ranged inputs
(C) To reduce the computational
cost of drawing the line
(C) It uses integer addition and
subtraction over floating point
(D) To determine the next pixel to
operations be plotted
(a) To improve the accuracy of the (C) Agile projects are often more
line susceptible to change
(D) To detemine the next pixel to 73. What are the three main types of
be plotted system analysis?
/20-A 14
80. Which of the following is a good 83. What is the purpose of software
example of a module with high testing?
cohesion?
(A) To find bugs in the software
(A) A module that performs
multiple unrelated tasks (8) To ensure that the software
meets its requirements
(8) A module that has a lot of global (C) To make sure that the software
variables
is easy to use
(C) A module that is tightly coupled (D) To improve the quality of the
to other modules software
(8) Coupling
(D) There is no difference between
a module and a component (C) None of the above
/20-A 15 I P.T.O.
87. Which of the following is used for 91. What is the space complexity of
mapping sentence plan into Greedy search?
sentence structure?
(A) O(b)
(A) Text planning
(8) O(bl)
(8) Sentence planning
(C) O(in)
(C) Text realization
(D) Expanding
89. Best-First Search is a type of
informed search, which uses
to choose the best next node for 93. Which of the following is not the
expansion. commonly used programming
language for Artificial Intelligence?
(A) evaluation function returning
lowest evaluation
(A) Perl
96. When will Hill climbing algorithm 99. What is/are the major component/
terminate? components for measuring
the performance of problem
(A) Stopping criterion met solving?
/20-A 17 I P.T-0.
SPACE FOR ROUGH WORK
/20-A 18
SPACE F`OR ROUGH WORK
/20-A 19 I P.T.O.
SPACE FOR ROUGH WORK
***
OTE-11/2023/20-A 20 PPP24/ 1 (082L130x4