SETHU INSTITUTE OF TECHNOLOGY
(An Autonomous Institution| Accredited with ‘A’ Grade by NAAC)
PULLOOR, KARIAPATTI – 626 115.
DEPARTMENT OF INFORMATION TECHNOLOGY
Question Bank for Comprehensive Engineering Aptitude Test
Multiple Choice Questions (1 Marks)
1. In a k-way set associative cache, the cache is divided into v sets, each of which consists of k
lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced
before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main
memory block numbered j must be mapped to any one of the cache lines from.
A. (j mod v) * k to (j mod v) * k + (k-1)
B. (j mod v) to (j mod v) + (k-1)
C. (j mod k) to (j mod k) + (v-1)
D. (j mod k) * v to (j mod k) * v + (v-1)
2. A computer has a 256 KB, 4-way set associative, write back data cache with block size of 32
bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry
contains in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit.
The number of bits in the tag field of an address is-
A. 11
B. 14
C. 16
D. 27
3. Consider the following sequence of micro-operations.
MBR ← PC
MAR ← X
PC ← Y
Memory ← MBR
Which one of the following is a possible operation performed by this sequence?
A. Instruction fetch
B. Operand fetch
C. Conditional branch
D. Initiation of interrupt service
4. The following code segment is executed on a processor which allows only register operands in its
instructions. Each instruction can have at most two source operands and one destination operand.
Assume that all variables are dead after this code segment.
c = a + b;
d = c * a;
e = c + a;
x = c * c;
if (x > a) {
y = a * a;
}
else {
d = d * d;
e = e * e;
}
Suppose the instruction set architecture of the processor has only two registers. The only allowed
compiler optimization is code motion, which moves statements from one place to another while
preserving correctness. What is the minimum number of spills to memory in the compiled code?
A. 0
B. 1
C. 2
D. 3
5. The amount of ROM needed to implement a 4 bit multiplier is
A. 64 bits
B. 128 bits
C. 1 Kbits
D. 2 Kbits
6. Consider a hypothetical processor with an instruction of type LW R1, 20(R2), which during
execution reads a 32-bit word from memory and stores it in a 32-bit register R1. The effective
address of the memory location is obtained by the addition of a constant 20 and the contents of
register R2. Which of the following best reflects the addressing mode implemented by this
instruction for operand in memory?
A. Immediate Addressing
B. Register Addressing
C. Register Indirect Scaled Addressing
D. Base Indexed Addressing
7. The smallest integer than can be represented by an 8-bit number in 2’s complement form is
A. -256
B. -128
C. -127
D. 0
8. Which one of the following is the tightest upper bound that represents the time complexity of
inserting an object into a binary search tree of n nodes?
A. O(1)
B. O(log n)
C. O(n)
D. O(n log n)
9. Which one of the following is the tightest upper bound that represents the number of swaps
required to sort n numbers using selection sort?
A. O(log n)
B. O(n)
C. O(n log n)
D. O(n2)
10. What is the worst case time complexity of inserting n 2 elements into an AVL-tree with n elements
initially?
A. n 2
B. n log n
2
C. n
4
D. n
3
11. Consider the problem of reversing a singly linked list. To take an example, given the linked list
below:
the reversed linked list should look like
Which one of the following statements is TRUE about the time complexity of algorithms that
solve the above problem in O(1) space?
A. The best algorithm for the problem takes n time in the worst case.
B. The best algorithm for the problem takes n log n time in the worst case.
C. The best algorithm for the problem takes n time in the worst case.
2
D. It is not possible to reverse a singly linked list in O(1) space.
12. What is the worst case time complexity of inserting n elements into an empty linked list, if the
linked list needs to be maintained in sorted order?
A. n 2
B. n
C. nlogn
D. 1
13. The result evaluating the postfix expression 10 5+60 6/*8− is
A. 284
B. 213
C. 142
D. 71
14. A function f defined on stacks of integers satisfies the following properties. f (φ) = 0 and f (push
(S, i)) = max (f(S), 0) + i for all stacks S and integers i. If a stack S contains the integers 2, -3, 2,
-1, 2 in order from bottom to top, what is f(S)?
A. 6
B. 4
C. 3
D. 2
15. Consider the tree arcs of a BFS traversal from a source node W in an unweighted, connected,
undirected graph. The tree T formed by the tree arcs is a data structure for computing
A. The shortest path between every pair of vertices.
B. The shortest path from W to every vertex in the graph.
C. The shortest path from W to only those nodes that are leaves of T.
D. The longest path in the graph.
16. Consider the following C program segment.
#include < stdio.h >
int main()
{
char s1[7] = "1234", *p;
p = s1 + 2;
*p = ‘0’;
printf("%s", s1);
}
What will be printed by the program?
A. 12.
B. 120400.
C. 1204.
D. 1034.
17. There are n unsorted arrays: A1, A2, ..., An. Assume that n is odd. Each of A 1, A2, ..., An contains
n distinct elements. There are no common elements between any two arrays. The worst-case time
complexity of computing the median of the medians of A1, A2, ..., An is
A. n
B. n logn
C. n logn
2
D. n
2
18. The worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are:
n logn n
A. n logn 2
B. n n n logn
2 2
n logn n logn
C. n 2
D. n n logn n
2 2
19. Consider the following array of elements.
{89,19,50,17,12,15,2,5,7,11,6,9,100}
The minimum number of interchanges needed to convert it into a max-heap is
A. 4.
B. 5.
C. 2.
D. 3.
20. Let G be a weighted connected undirected graph with distinct positive edge weights. If every
edge weight is increased by the same value, then which of the following statements is/are TRUE?
P: Minimum spanning tree of G does not change
Q: Shortest path between any pair of vertices does not change
A. P Only.
B. Q Only.
C. Neither P nor Q.
D. Both P and Q.
21. To implement Dijkstra’s shortest path algorithm on unweighted graphs so that it runs in linear
time, the data structure to be used is:
A. Queue.
B. Stack.
C. Heap.
D. B-Tree.
22. The Floyd-Warshall algorithm for all-pair shortest paths computation is based on
A. Greedy paradigm.
B. Divide- and- conquer paradigm.
C. Dynamic programming paradigm.
D. Neither Greedy nor Divide- and- conquer nor Dynamic programming paradigm.
23. Match the following:
List 1
(P) Prim’s algorithm for minimum spanning tree
(Q) Floyd-Warshall algorithm for all pairs shortest paths
(R) Mergesort
(S) Hamiltonian circuit
List 2
(i) Backtracking
(ii) Greedy method
(iii) Dynamic programming
(iv) Divide and conquer
A. P-iii, Q-ii, R-iv, S-i.
B. P-i, Q-ii, R-iv, S-iii.
C. P-ii, Q-iii, R-iv, S-i.
D. P-ii, Q-i, R-iii, S-iv.
24. Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q
is polynomial time reducible to S and S is polynomial-time reducible to R. Which one of the
following statements is true?
A. R is NP-complete.
B. R is NP-hard.
C. Q is NP-complete.
D. Q is NP-hard.
Multiple Choice Questions (2 Marks)
1. Consider a 4-way set associative mapping with 16 cache blocks. The memory block requests are
in the order-
0, 255, 1, 4, 3, 8, 133, 159, 216, 129, 63, 8, 48, 32, 73, 92, 155
If LRU replacement policy is used, which cache block will not be present in the cache?
A. 3
B. 8
C. 129
D. 216
2. On a non-pipelined sequential processor, a program segment, which is a part of the interrupt
service routine, is given to transfer 500 bytes from an I/O device to memory.
Initialize the address register
Initialize the count to 500
LOOP: Load a byte from device
Store in memory at address given by address register
Increment the address register
Decrement the count
If count != 0 go to LOOP
Assume that each statement in this program is equivalent to machine instruction which takes one
clock cycle to execute if it is a non-load/store instruction. The load-store instructions take two
clock cycles to execute. The designer of the system also has an alternate approach of using DMA
controller to implement the same transfer. The DMA controller requires 20 clock cycles for
initialization and other overheads. Each DMA transfer cycle takes two clock cycles to transfer
one byte of data from the device to the memory. What is the approximate speedup when the
DMA controller based design is used in place of the interrupt driven program based input-output?
A. 3.4
B. 4.4
C. 5.1
D. 6.7
3. Consider evaluating the following expression tree on a machine with load-store architecture in
which memory can be accessed only through load and store instructions. The variables a, b, c, d
and e initially stored in memory. The binary operators used in this expression tree can be
evaluating by the machine only when the operands are in registers. The instructions produce
results only in a register. If no intermediate results can be stored in memory, what is the minimum
number of registers needed to evaluate this expression?
A. 2
B. 9
C. 5
D. 3
4. A RAM chip has a capacity of 1024 words of 8 bits each (1K * 8). The number of 2 * 4
decoders with enable line needed to construct a 16K * 16 RAM from 1K * 8 RAM is
(A) 4 (B) 5 (C) 6 (D) 7
5. Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction
(FI), Decode Instruction (DI), Fetch Operand (FO), Execute Instruction (EI) and Write Operand
(WO). The stage delays for FI, DI, FO, EI and WO are 5 ns, 7 ns, 10 ns, 8 ns and 6 ns,
respectively. There are intermediate storage buffers after each stage and the delay of each buffer
is 1 ns. A program consisting of 12 instructions I1, I2, I3, …, I12 is executed in this pipelined
processor. Instruction I4 is the only branch instruction and its branch target is I9. If the branch is
taken during the execution of this program, the time (in ns) needed to complete the program is
A. 132
B. 165
C. 176
D. 328
6. Consider the following operation along with Enqueue and Dequeue operations on queues, where
k is a global parameter
MultiDequeue(Q) {
m= k
while (Q is not empty) and (m> 0) {
Dequeue(Q)
m= m-1
}
}
What is the worst case time complexity of a sequence of n queue operations on an initially
empty queue?
A. n
B. n k
C. nk
D. n 2
7. The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, and 42.
Which one of the following is the post order traversal sequence of the same tree?
A. 10, 20,15, 23, 25,35, 42,39,30
B. 15,10, 25, 23, 20, 42,35,39,30
C. 15, 20,10, 23, 25, 42,35,39,30
D. 15,10, 23, 25, 20,35, 42,39,30
8. Consider the following function
int unknown int n{
int i, j, k 0;
for i n / 2; i n; i
for j 2; j n; j
j* 2 k k n / 2;
return k ;
}
The return value of the function is
n 2
B. n 2 log n
C. n 3
D. n 3 log n
9. Consider the following code sequence having five instructions I1 to I5. Each of these instructions
has the following format.
OP Ri, Rj, Rk
where operation OP is performed on contents of registers Rj and Rk and the result is stored in
register Ri.
I1:ADD R1,R2,R3
I2:MUL R7,R1,R3
I3:SUB R4,R1,R5
I4:ADD R3,R2,R4
I5:MUL R7,R8,R9
Consider the following three statements.
S1: There is anti-dependence between instructions L2 and L5
S2: There is anti-dependence between instructions L2 and L4
S3: Within an instruction pipeline anti-dependence always creates one or more stalls.
Which one of above statements is/are correct?
A. Only S1 true.
B. Only S2 true.
C. Only S1 and S3are true.
D. Only S2 and are true.
10. Consider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple
uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3
insertions?
A. (97 * 97 * 97)/1003
B. (99 * 98 * 97)/1003
C. (97 * 96 * 95)/1003
D. (97 * 96 * 95)/(3! * 1003)
11. Consider a hash table with 9 slots. The hash function is h(k) = k mod 9. The collisions are
resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17,
10. The maximum, minimum, and average chain lengths in the hash table, respectively, are
A. 3, 0, and 1.
B. 3, 3, and 3.
C. 4, 0, and 1.
D. 3, 0, and 2.
12. Suppose a stack implementation supports an instruction REVERSE, which reverses the order of
elements on the stack, in addition to the PUSH and POP instructions. Which one of the following
statements is TRUE with respect to this modified stack?
A. A queue cannot be implemented using this stack.
B. A queue can be implemented where ENQUEUE takes a single instruction and DEQUEUE takes a
sequence of two instructions.
C. A queue can be implemented where ENQUEUE takes a sequence of three instructions and
DEQUEUE takes a single instructions.
D. A queue can be implemented where both ENQUEUE and DEQUEUE take a single instruction
each.
13. Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements.
Assume that the insertion and deletion operations are carried out using REAR and FRONT as
array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue
full and queue empty are
A. Full: (REAR+1)
Mod n = = FRONT
Empty: REAR = = FRONT.
B. Full: (REAR+1)
Mod n = = FRONT
Empty: FRONT + 1.
C. Full: REAR = =FRONT
Empty: (REAR + 1)
Mod n = = FRONT
D. Full: (FRONT+1)
Mod n = = REAR
Empty: REAR = = FRONT.
14. Consider the following C program:
#include
#define EOF -1
void push (int); /* push the argument on the stack */
int pop (void); /* pop the top of the stack */
void flagError ();
int main () {
int c, m, n, r;
while ((c = getchar ()) != EOF) {
if (isdigit (c) )
push (c);
else if ((c == '+') || (c == '*')) {
m = pop ();
n = pop ();
r = (c == '+')? n + m : n*m;
push (r);
} else if (c != ' ')
flagError ();
}
printf("% c", pop ());
}
What is the output of the program for the following input? 5 2 * 3 3 2 + * +
A. 15.
B. 25.
C. 30.
D. 150.
15. In an adjacency list representation of an undirected simple graph G=(V,E), each edge (u,v) has
two adjacency list entries: [v] in the adjacency list of u, and [u] in the adjacency list of v. These
are called twins of each other. A twin pointer is a pointer from an adjacency list entry to its twin.
If |E|=m and |V|=n, and the memory size is not a constraint, what is the time complexity of the
most efficient algorithm to set the twin pointer in each entry in each adjacency list?
n 2
B. n + m
C. m 2
D. n 4
16. Consider the following ANSI C program.
#include <stdio.h>
int main( ) {
int i, j, count;
count = 0;
i = 0;
for (j = -3; j <= 3; j++) {
if ((j >= 0) && (i++))
count = count + j;
}
count = count + i;
printf("%d", count);
return 0;
}
Which one of the following options is correct?
A. The program will compile successfully and output 10 when executed.
B. The program will compile successfully and output 8 when executed.
C. The program will compile successfully and output 13 when executed.
D. The program will not compile successfully.
17. Consider the following array.
23 32 45 69 72 73 89 97
Which algorithm out of the following options uses the least number of comparisons (among the
array elements) to sort above array in ascending order?
A. Insertion sort.
B. Selection sort.
C. Quicksort using the last element as pivot.
D. Merge sort.
18. An operator delete(i) for a binary heap data structure is to be designed to delete the item in the i-
th node. Assume that the heap is implemented in an array and i refers to the i-th index of the
array. If the heap tree has depth d (number of edges on the path from the root to the farthest leaf),
then what is the time complexity to re-fix the heap efficiently after the removal of the element?
1
B. d but not 1
C. 2 d but not d
D. d 2 but not 2
d d
19. Consider the following statements:
I. The smallest element in a max-heap is always at a leaf node
II. The second largest element in a max-heap is always a child of the root node
III. A max-heap can be constructed from a binary search tree in Θ(n) time
IV. A binary search tree can be constructed from a max-heap in Θ(n) time
Which of the above statements are TRUE?
A. I, II, and III.
B. I, III, and IV.
C. I, II, and IV.
D. II, III, and IV.
20. Consider the following pseudo code. What is the total number of multiplications to be performed?
D=2
for i = 1 to n do
for j = i to n do
for k = j + 1 to n do
D=D*3
A. Half of the product of the 3 consecutive integers.
B. One-third of the product of the 3 consecutive integers.
C. One-sixth of the product of the 3 consecutive integers.
D. None of the above.
G maintained using adjacency lists. Suppose a new weighted edge (u, v) ∈ V × V is added to G.
21. Let G = (V, E) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of
The worst case time complexity of determining if T is still an MST of the resultant graph is
|E| + |V|
B. |E||V|
C. |E| log|V|
D. |V|
22. The subset-sum problem is defined as follows:
Given a set S of n positive integers and a positive integer W, determine whether there is a subset
of S Whose elements sum to W. An algorithm Q solves this problem in O(nW) time. Which of
the following statements is false?
A. Q solves the subset-sum problem in polynomial time when the input is encoded in unary.
B. Q solves the subset-sum problem in polynomial time when the input is encoded in binary.
C. The subset sum problem belongs to the class NP.
D. The subset sum problem is NP-hard.
Multiple Select Questions (2 Marks)
1. Consider the following recurrence:
f(1) = 1;
f(2n) = 2f(n) − 1, for n ≥ 1;
f(2n + 1) = 2f(n) + 1, for n ≥ 1;
Then, which of the following statements is/are TRUE?
A. f(2n -1)=2n - 1.
B. f(2n ) = 1.
C. f(5.2n)=2n+1 + 1.
D. f(2n + 1)=2n + 1.
2. Which of the following is/are valid statement(s) of the spanning tree of a connected undirected
graph G (V,E)?
A. Spanning Tree of G(V,E) must contain (V–1) number of edges.
B. Spanning Tree of G(V,E) is minimally connected.
C. Spanning Tree of G(V,E) is maximally cyclic.
D. Spanning Tree of G(V,E) must contain (E–1) number of edges.
3. Which of the following is /are true about the binary relation s = (empty set) on Set A = {1, 2, 3}
A. Symmetric.
B. Irreflexive.
C. Reflexive.
D. Transitive.
4. Address instructions are supported in:
A. AC-based Architecture.
B. Register-based Architecture.
C. Stack-based Architecture.
D. Register-memory based Architecture.
5. Which of the following cache mapping(s) may experience conflict miss?
A. Direct Mapping.
B. 2-way set associative mapping.
C. 4-way set associative mapping.
D. Fully associative mapping.
6. A 32-bits wide main memory of size 8GB is formed using A * B-bits DRAM chips. Which of the
following is/are true regarding the memory system?
A. Chips are arranged in 4 * 4 if 128M *8-bits chip is used to form the memory.
B. 16 number of bye-addressable chips are required each of 512M cells.
C. Chips are arranged in 16 * 4 if 4-bits chip is used to form the memory.
D. 5 *32 decoder is needed if 64M
E. + * 4 if 4-bits chip is used to form the memory.
7. Which of the following can be the value(s) of PC immediately after the fetch of an instruction
which is stored on a location 400?
A. 400.
B. 399.
C. 401.
D. 402.
8. A processor uses a memory of 4GB capacity in total. Possible address bus sizes are/ are?
A. 30.
B. 31.
C. 32.
D. 33.
9. Which of the following statements are true?
A. For all inputs, merge sorts runs in O(n2) time.
B. For all inputs, quick sorts runs in O(n2) time.
C. For all inputs, insertion sorts runs in Ω(n2) time.
D. Every comparison based sorting algorithm runs in Ω(1) time.
10. Create lexically ordered binary search tree for the following names: raj, ram, joy, sue, ank, ravi,
ajay, joe, biku, binod, cat, cow, dog. Which of the followings are true?
A. Number of leaf nodes in left sub tree of root node are 2.
B. Number of leaf nodes in right sub tree of root node is 1.
C. Total number of nodes in left sub tree of root node is 9.
D. Total number of nodes in right sub tree of root node is 3.
11. Consider the following functions.
Void fun(struct node *t)
{
If(t)
{
Fun(t->lchild)
Printf(“%d”,t->data);
Fun(t->rchild);
}
}
Which of the following is / are true?
A. Function is correct implementation to find in-order traversal of binary tree.
B. Output print by the function is 4 2 5 1 3 7 6.
C. Output print by the function is 4 2 5 1 3 6 7.
D. Output print by the function is 4 2 5 1 7 6 3.
12. A binary search tree is used to locate the number 43. Which of the following probe sequences are
possible?
A. 60 51 13 17 40 43.
B. 1 2 49 39 59 43.
C. 11 60 30 48 35 43.
D. 80 60 50 14 40 43.
13. Which of the following is/ are true for the given tree?
A. Converse in-order traversal of tree is 5 7 3 1 2 6 4.
B. Converse pre-order traversal of tree is 1 3 5 7 2 4 6.
C. Converse post-order traversal of tree is 7 5 3 6 4 2 1.
D. Reverse of post-order traversal of tree is 1 3 5 7 2 4 6.
14. Which of the following graph is not a topological ordering of the graph?
A. G B A F D C
B. G A F B D C.
C. B D F G A C.
D. B G D F A C.
15. Which of the following is / are true about below AVL tree?
A. Converse in-order traversal of AVL tree is 25,20,15,9,8,7,6,3.
B. In-order traversal of AVL tree is 3,6,7,8,9,15,20,25.
C. Pre-order traversal of AVL tree is 15,6,3,8,7,9,20,25.
D. Converse post-order of AVL tree is 3,7,9,8,6,20,25,15.
Numerical Answer Type Questions (2 Marks)
1. A block-set associative cache memory consists of 128 blocks divided into four block sets. The
main memory consists of 16,384 blocks and each block contains 256 eight bit words.
A. How many bits are required for addressing the main memory?
B. How many bits are needed to represent the TAG, SET and WORD fields?
2. Consider a direct mapped cache with 8 cache blocks (0-7). If the memory block requests are in
the order-
3, 5, 2, 8, 0, 6, 3, 9, 16, 20, 17, 25, 18, 30, 24, 2, 63, 5, 82, 17, 24
Which of the following memory blocks will not be in the cache at the end of the sequence?
Also, calculate the hit ratio and miss ratio.
3. A processor has 64 registers and uses 16-bit instruction format. It has two types of instructions: I-
type and R-type. Each I-type instruction contains an opcode, a register name, and a 4-bit
immediate value. Each R-type instruction contains an opcode and two register names. If there are
8 distinct I-type opcodes, then the maximum number of distinct R-type opcodes is _____.
4. A processor has 16 integer registers (R0,R1,..,R15) and 64 floating point registers (F0,F1,
…,F63). It uses a 2-byte instruction format. There are four categories of instructions: Type-
1, Type-2, Type-3, and Type-4. Type-1 category consists of four instructions, each with 3 integer
register operands (3Rs). Type-2 category consists of eight instructions, each with 2 floating point
register operands (2Fs). Type-3 category consists of fourteen instructions, each with one integer
register operand and one floating point register operand (1R+1F). Type-4 category consists
of N instructions, each with a floating point register operand (1F).
The maximum value of N is __________.
5. Suppose a binary search tree with 1000 distinct elements is also a complete binary tree. The tree
is stored using the array representation of binary heap trees. Assuming that the array indices start
with 0, the 3rd largest element of the tree is stored at index ___________.
6. The postorder traversal of a binary tree is 8,9,6,7,4,5,2,3,1. The inorder traversal of the same tree
is 8,6,9,4,7,2,5,1,3. The height of a tree is the length of the longest path from the root to any leaf.
The height of the binary tree above is ______.
7. Consider the following sequence of operations on an empty stack.
push(54); push(52); pop(); push(55); push(62); s = pop();
Consider the following sequence of operations on an empty queue.
enqueue(21); enqueue(24); dequeue(); enqueue(28); enqueue(32); q = dequeue();
The value of s + q is ______
8. Consider the queues Q1 containing four elements and Q2 containing none (shown as the Initial
State in the figure). The only operations allowed on these two queues are Enqueue (Q, element)
and Dequeue (Q). The minimum number of Enqueue operations on Q1 required to place the
elements of Q1 in Q2 in reverse order (shown as the Final State in the figure) without using any
additional storage is ______________.
9. Consider a double hashing scheme in which the primary hash function is
h1(k)=k mod 23, and the secondary hash function is h 2(k)=1+(k mod 19).
Assume that the table size is 23. Then the address returned by probe 1 in the probe sequence
(assume that the probe sequence begins at probe 0) for key value k=90 is _______.
10. Breadth First Search (BFS) is started on a binary tree beginning from the root vertex. There is a
vertex t at a distance four from the root. If t is the n-th vertex in this BFS traversal, then the
maximum possible value of n is ___________.
11. Consider the following directed graph:
The number of different topological orderings of the vertices of the graph is ________________.
12. Let G be a graph with 100! Vertices, with each vertex labelled by a distinct permutation of the
numbers 1, 2,…,100. There is an edge between vertices u and v if and only if the label of u can be
obtained by swapping two adjacent numbers in the label of v. Let y denote the degree of a vertex
in G, and z denote the number of connected components in G. Then, y+10z= _____.
13. Consider the following C program:
#include < stdio.h >
int jumble (int x, int y) {
x=2*x+y;
return x ;
}
int main ( ) {
int x=2, y=5 ;
y = jumble (y, x) ;
x = jumble (y, x) ;
printf ("%d \n", x) ;
return 0 ;
}
The value printed by the program is ______.
14. Consider the following C program:
#include < stdio.h >
int counter = 0;
int calc (int a, int b) {
int c;
counter++;
if (b==3) return (a*a*a);
else {
c = calc(a, b/3);
return (c*c*c);
}
}
int main (){
calc(4, 81);
printf ("%d", counter);
}
The output of this program is _____.
15. Consider the following ANSI C function:
int SimpleFunction (int y[], int n, int x)
{
int total = y[0], loopIndex;
for (loopIndex = 1; loopIndex <= n - 1; loopIndex++)
total = x * total + y[loopIndex];
return total :
}
Let Z be an array of 10 elements with Z[i] = 1, for all i such that 0 ≤ i ≤ 9. The value returned by
SimpleFunction (Z, 10, 2) is ______
16. Consider the following C functions.
int fun1 (int n) {
static int i = 0;
if (n > 0) {
++i;
fun1(n-1);
}
return (i);
}
__________________
int fun2 (int n) {
static int i = 0;
if (n > 0) {
i = i + fun1 (n);
fun2(n-1);
}
return (i);
}
The return value of fun2 (5) is _______.
17. The given diagram shows the flowchart for a recursive function A(n). Assume that all statements,
except for the recursive calls, have O(1) time complexity. If the worst case time complexity of
this function is O(nα), then the least possible value (accurate up to two decimal positions) of α is
____________ .
18. An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is
chosen uniformly at random. The probability that the pivot element gets placed in the worst
possible location in the first round of partitioning (rounded off to 2 decimal places) is ______.
19. The number of possible min-heaps containing each value from {1,2,3,4,5,6,7} exactly once is
_____.
20. A complete binary min-heap is made by including each integer in [1,1023] exactly once. The
depth of a node in the heap is the length of the path from the root of the heap to that node. Thus,
the root is at depth 0. The maximum depth at which integer 9 can appear is ___________.
21. The minimum number of arithmetic operations required to evaluate the polynomial P(X) = X 5 +
4X3 + 6X + 5 for a given value of X using only one temporary variable is _____.
22. The minimum number of comparisons required to find the minimum and the maximum of 100
numbers is ________
23. Consider a graph G = (V, E), where V = {v 1, v2, ...., v100},
E = {(vi, vj) | 1 ≤ i < j ≤ 100}, and weight of the edge (v i, vj) is |i - j|. The weight of the minimum
spanning tree of G is ______.
24. Consider the following undirected graph G:
Choose a value for x that will maximize the number of minimum weight spanning
trees (MWSTs) of G. The number of MWSTs of G for this value of x is ______.
25. Let A1,A2,A3, and A4 be four matrices of dimensions 10×5,5×20,20×10, and 10×5, respectively.
The minimum number of scalar multiplications required to find the product A1A2A3A4 using the
basic matrix multiplication method is ______________.
Section1:Discrete and Engineering Mathematics
Mathematical Logic: propositional and first order logic.
Set Theory & Algebra: Sets,relations,functions,patial orders,lattices and groups.
Combinatorics: counting,recurrence relations,generating functions.
Graph Theory: connectivity,matching,coloring.
Probability: Random variables,uniform,normal,exponential, poisson, binomial distribution,mean,
Mode,median,standard deviation,conditional probability and bayes theorem.
Linear Algebra: Matrics,determinats,system of linear equations, eigen values and eigen vectors
LU decomposition.
Calculus: limits,continuity and differentiability,maxima and minima,Mean value
theorem,Integration.
Section 2: Digital Logic
Logic Functions,Minimization,Design and Synthesis of Combinational and sequential
circuits,number representation and computer arithmetic(fixed and floating point).
Section 3: Computer Organization and Architecture
Machine instructions and addressing modes,ALU and data-path,CPU control design,Mempry
interface,I/O interface(interrupt and DMA mode),instruction pipelining,cache and main
memory,Secondary storage.
Section 4: Programming and Data Structures
Programming in C, Functions, Recursion, Parameter passing, Scope Binding,Abstract data
types, Arrays, stacks, queues, linked lists, trees, binary search trees, binary heaps, graphs.
Section 5: Algorithms
Analysis,Asymptotic notation,Notions of space and time complexity,worst and average case
analysis, Design:Greedy approach, Dynamic programming, Divide and conquer; Tree and graph
traversals,connected components, spanning trees,shortest paths,Hashing,sorting,
searching,Asymptotic analysis(best,worst,average cases)of tiem and space,upper and lower
boards,Basic concepts of complexity classes-P,NP,NP-hard,NP-complete.
Section 6: Compiler Design
Lexical Analysis,parsing,Syntax direted translation,Runtime Environments,Intermediate and
target code generation, Basic codes of optimization.
Section 7:Operating System
Processes,threads,inter-process communication,Concurrency,Synchronization,Deadlock,CPU
Scheduling,Memory management and virtual memory,File System,I/O system,Protection and
security.
Section 8:Databases
ER-model,relational model(relational algebra,tuple calculus),Database design(integrity
constraints,normal forms),Query languages(SQL),File Structures(sequential Files,indexing,B
and B+ trees),Transactions and concurrency control.
Section 9: Computer Networks
ISO/OSI stack, LAN technologies(Ethernet and Token ring), Flow and error control
techniques,Rating algorithms,congestion control,TCP/UDP and sockets,IP(v4),Application layer
protocols(ICMP,DNS,SMTP,POP,FTP,HTTP).Basic concepts of hubs,switches,gateways and
[Link] Security:Basic concepts of public and private key cryptography,digital
signature,firewalls.
Section 10:General Aptitude
Verbal Ability:English,grammer,sentence completion,verbal analaysis,word
groups,instructions,cribical reasoning and verbal deduction,Numerial Ability:Numerical
computation,numerical estimation,numerical reasoning and data interpretation.