Professional Documents
Culture Documents
------------
1. int SizeOfArray(arr)
int arr[];
{
return (sizeof(arr)/sizeof(int));
}
void main()
{
int ArrOfInt[24];
int *PtrToArray;
PtrToArray=(int *)malloc(sizeof(int)*24);
printf("%d %d ",(sizeof(ArrOfInt)/sizeof(int)),SizeOfArray(ArrOfInt));
printf("%d %d ",(sizeof(PtrToArray)/sizeof(int)),SizeOfArray(PtrToArray));
free(PtrToArray);
}
Assuming the size of integer and the size of an integer pointer to be equal,
what is the output of the above program?
a) 24 24 24 24 b) 24 24 24 1 c) 24 24 1 1 d) 24 1 1 1
2. The register qualifier can be applied only to those variables that are
a) static and auto b) auto and extern c) static only d) auto only
4. void main()
{
printf("%s%c%c%c%c",&7["TREADING"],1["TREADING"],2["TREADING"],
3["TREADING"],"TREADING"[0]);
}
a) putchar()
b) putc()
c) fputc()
d) fprintf()
7. When a program is started, the files that are opened automatically are
a) stdin
b) stderr
c) stdin, stdout and stderr
d) None
a) %?
b) %!
c) %$
d) %*
a) while block
b) do while block
c) switch block
d) for block
OS
--
1. A print job is given to a laserjet at the same time in the following order :
3 pages of A, 5 pages of B, 11 pages of C and 7 pages of D. If the printer
prints A first, followed by B, D and C in that order, what scheduling
algorithm has it followed?
2. For a deadlock to occur, which of the following conditions need not be true?
a) External fragmentation
b) Compaction
c) Compression
d) Internal fragmentation
5. When files and directories can be shared by different users, the file system
resembles a
Data Structures
---------------
a) O(log k)
b) O(log n)
c) O(n.log k)
d) O(k.log n)
9 8 7 6 5 3 1 1
8 9 6 7 3 5 1 1
6 7 8 9 1 1 3 5
1 1 3 5 6 7 8 9
a) Heap sort
b) Bubble sort
c) Quick sort
d) Merge sort
3. Assume that START is any node in a circularly linked list (singly linked).
Consider the following algorithm to delete a node PTR in the list.
for (k=0;k<100;k++)
{
<some unit time operations>
}
}
}
a) O(n^2)
b) O(k.n^2)
c) O(k.log n)
d) O(n.log n)
5. In a binary tree, which traversal would reach the leaf nodes last?
a) Inorder traversal
b) Depth first traversal
c) Breadth first traversal
d) Preorder traversal
a) Linked list
b) Stack
c) Binary tree
d) Hash table
8. The number of paths from the root to all the leaf nodes in a directed
complete binary tree of height n is
a) 2n
b) 2^n
c) (2^n)^n
d) (2n)^n
9. Consider the following recursive equation. What does it generate?
f(n) = f(f(n-1)) + f(n-f(n-1)) with f(1)=1 and f(2)=1
a) 1,1,1,1,1,1...
b) 1,1,2,3,5,8...
c) 1,1,2,2,3,3...
d) 1,1,11,11,1111,1111...
10. The maximum length of the shortest path between two vertices in a complete
undirected graph of n vertices is
a) n
b) log n
c) n - 1
d) 1
--------------17F1CCB8B3A58C2284B6FF8A
Content-Type: text/x-vcard; charset=us-ascii;
name="raghu.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Raghuraman R
Content-Disposition: attachment;
filename="raghu.vcf"
begin:vcard
n:R;Raghuraman
tel;work:(080) 5099 113
x-mozilla-html:FALSE
org:ASIC;Texas Instruments
version:2.1
email;internet:raghu@ti.com
title:Software Design Engineer
adr;quoted-printable:;;Golf view Homes,=0D=0AWind Tunnel
Road,=0D=0AMurgeshpalya;Bangalore;Karnataka;560017;India
x-mozilla-cpt:;3992
fn:Raghuraman R
end:vcard
--------------17F1CCB8B3A58C2284B6FF8A--