Consider the following rooted tree with the vertex labelled P as the root

**A. ** SQPTRWUV

**B. ** SQPTUWRV

**C. ** SQPTWUVR

**D. ** SQPTRUWV

**Answer : ****Option A**

**Explaination / Solution: **

The In order Traversal of Ternary Tree is done as follows: Left → Root → Middle → Right So the nodes are visited in SQPTRWUV order.

The order in which the nodes are visited during an in-order traversal of the tree is

The In order Traversal of Ternary Tree is done as follows: Left → Root → Middle → Right So the nodes are visited in SQPTRWUV order.

Workspace

Report

Consider the following graph:

**A. ** (b,e) (e,f) (a,c) (b,c) (f,g) (c,d)

**B. ** (b,e) (e,f) (a,c) (f,g) (b,c) (c,d)

**C. ** (b,e) (a,c) (e,f) (b,c) (f,g) (c,d)

**D. ** (b,e) (e,f) (b,c) (a,c) (f,g) (c,d)

**Answer : ****Option D**

**Explaination / Solution: **

No Explaination.

Which of the following is NOT the sequence of edges added to the minimum spanning tree using
Kruskal’s algorithm?

No Explaination.

Workspace

Report

A subsequence of a given sequence is just the given sequence with some elements (possibly none or
all) left out. We are given two sequences X[m] and Y[n] of lengths m and n, respectively, with indexes of
X and Y starting from 0.

**A. ** expr1 ≡ l(i - 1, j) + 1

**B. ** expr1 ≡ I(i, j - 1)

**C. ** expr2 ≡ max(I(i - 1, j), I(i, j - 1))

**D. ** expr2 ≡ max(I(i - 1, j - 1), I(i, j))

**Answer : ****Option C**

**Explaination / Solution: **

No Explaination.

We wish to find the length of the longest common subsequence (LCS) of X[m] and Y[n] as l(m, n),
where an incomplete recursive definition for the function l(i, j) to compute the length of the LCS of
X[m] and Y[n] is given below:

l(i, j) = 0, if either i = 0 or j = 0

= expr1, if i, j>0 and x[i - 1] = Y[j - 1]

= expr2, if i, j>0 and x[i - 1] ≠ Y[j - 1]

Which one of the following option is correct?

No Explaination.

Workspace

Report

In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the
following is TRUE?

**A. ** In both AST and CFG, let node, N_{2} be the successor of node N_{1}. In the input program, the
code corresponding to N_{2} is present after the code corresponding in N_{1}.

**B. ** For any input program, neither AST nor CFG will contain a cycle

**C. ** The maximum number of successors of a node in an AST and a CFG depends on the input program

**D. ** 4Each node is AST and CFG corresponds to at most one statement in the input program

**Answer : ****Option C**

**Explaination / Solution: **

Optional (A) is not true when CFG contains cycle Option (B) is false as CFG can contain cycle Option (D) is false as a single node can contain block of statements.

Optional (A) is not true when CFG contains cycle Option (B) is false as CFG can contain cycle Option (D) is false as a single node can contain block of statements.

Workspace

Report

A max-heap is a heap where the value of each parent is greater than or equal to
the value of its children. Which of the following is a max-heap?

**A. **

**B. **

**C. **

**D. **

**Answer : ****Option B**

**Explaination / Solution: **

Heap is a complete binary tree

Heap is a complete binary tree

Workspace

Report

Which of the given options provides the increasing order of asymptotic
complexityoffunctions f_{1},f_{2},f_{3 }and f_{4}?

**A. ** f3, f2, f4, f1

**B. ** f3, f2, f1, f4

**C. ** f2, f3, f1, f4

**D. ** f2, f3, f4, f1

**Answer : ****Option A**

**Explaination / Solution: **

Workspace

Report

We are given a set of n distinct elements and an unlabeled binary tree with n
nodes. In how many ways can we populate the tree with the given set so that it
becomes a binary search tree?

**A. ** 0

**B. ** 1

**C. ** n!

**D. **

**Answer : ****Option D**

**Explaination / Solution: **

No Explaination.

No Explaination.

Workspace

Report

An undirected graph G(V,E) contains n ( n > 2 ) nodes named v1, v2,....vn . Two nodes vi, vj are connected if and only if 0 < |i − j| ≤ 2. Each edge (vi ,vj ) is assigned a weight i + j. A sample graph with n = 4 is shown below

**A. ** 11

**B. ** 25

**C. ** 31

**D. ** 41

**Answer : ****Option C**

**Explaination / Solution: **

The length of the path from v_{5} to v_{6} in the MST of previous question with n = 10
is

12 + 8 + 4 + 3 + 6 + 10 = 31

Workspace

Report

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?

**A. ** O(1)

**B. ** O(d) but not O(1)

**C. ** O(2d ) but not O(d)

**D. ** O(d 2d ) but not O(2d )

**Answer : ****Option B**

**Explaination / Solution: **

Time complexity of heapification is O (height) =O(d)

Time complexity of heapification is O (height) =O(d)

Workspace

Report

Threads of a process share

**A. ** global variable but not heap.

**B. ** heap but not global variables.

**C. ** neither global variables nor heap.

**D. ** Both heap and global variables

**Answer : ****Option D**

**Explaination / Solution: **

Threads of a process can share all resources except stack and register set.

Threads of a process can share all resources except stack and register set.

Workspace

Report

**Preparation Study Material**- Digital Electronics (Study/Preparation)
- Digital Logic Circuits (Study/Preparation)
- Computer Architecture (Study/Preparation)
- Programming and Data Structures I (Study/Preparation)
- Programming and Data Structure II (Study/Preparation)
- Database Management Systems (Study/Preparation)
- Computer Networks (Study/Preparation)
- Operating Systems (Study/Preparation)
- Software Engineering (Study/Preparation)
- Theory of Computation (Study/Preparation)
- Design and Analysis of Algorithms (Study/Preparation)
- Compiler Design (Study/Preparation)

- Engineering Mathematics (Practise Test)
- Digital Logic (Practise Test)
- Computer Organization and Architecture (Practise Test)
- Programming and Data Structures (Practise Test)
- Algorithms (Practise Test)
- Theory of Computation (Practise Test)
- Compiler Design (Practise Test)
- Operating System (Practise Test)
- Databases (Practise Test)
- Computer Networks (Practise Test)