MCQ For Oba
MCQ For Oba
Explanation: In a walk if the vertices are distinct it is called a path, whereas if the edges are
distinct it is called a trail.
Explanation: Out of n*n possible values for a simple graph the diagonal values will always
be zero.
Explanation: No explanation.
4.A connected planar graph having 6 vertices, 7 edges contains
_____________ regions.
A. 15
B. 3
C. 1
D. 11
View Answer
Ans : B
Explanation: By euler’s formula the relation between vertices(n), edges(q) and regions(r) is
given by n-q+r=2.
Explanation: No explanation
Explanation: Let one set have n vertices another set would contain 10-n vertices.
Total number of edges would be n*(10-n), differentiating with respect to n, would yield the
answer.
Explanation:For each check of a word of length S1, we need to follow at most S1 edges.
11. What is the number of edges present in a complete graph having n
vertices?
A. (n*(n+1))/2
B. (n*(n-1))/2
C. n
D. Information given is insufficient
View Answer
Ans : B
Explanation: Number of ways in which every vertex can be connected to each other is nC2.
12. In a simple graph, the number of edges is equal to twice the sum of
the degrees of the vertices.
A. True
B. False
View Answer
Ans : B
Explanation: The sum of the degrees of the vertices is equal to twice the number of edges.
13. If a simple graph G, contains n vertices and m edges, the number of
edges in the Graph G'(Complement of G) is ___________
A. (n*n-n-2*m)/2
B. (n*n+n+2*m)/2
C. (n*n-n-2*m)/2
D. (n*n-n+2*m)/2
View Answer
Ans : A
Explanation: The union of G and G’ would be a complete graph so, the number of edges in
G’= number of edges in the complete form of G(nC2)-edges in G(m).
14. Which of the following properties does a simple graph not hold?
A. Must be connected
B. Must be unweighted
C. Must have no loops or multiple edges
D. All of the mentioned
View Answer
Ans : A
16. For a given graph G having v vertices and e edges which is connected
and has no cycles, which of the following statements is true?
A. v=e
B. v = e+1
C. v + 1 = e
D. None of the mentioned
View Answer
Ans : B
Explanation: For any connected graph with no cycles the equation holds true.
Explanation: A graph is eulerian if either all of its vertices are even or if only two of its
vertices are odd.
18. A graph with all vertices having equal degree is known as a __________
A. Multi Graph
B. Regular Graph
C. Simple Graph
D. Complete Graph
View Answer
Ans : B
Explanation: The given statement is the definition of regular graphs.Explanation: The given
statement is the definition of regular graphs.
Explanation: The 3 listed methods can be used, the choice depends on the ease of use.
20. The time complexity to calculate the number of edges in a graph
whose information in stored in form of an adjacency matrix is ____________
A. O(V)
B. O(E2)
C. O(E)
D. O(V2)
View Answer
Ans : D
1. The no of external nodes in a full binary tree with n internal nodes is?
A. n
B. n+1
C. 2n
D. 2n + 1
View Answer
Ans : B
Explanation: The no of external nodes in a full binary tree with n internal nodes is n+1.
Explanation: A full binary tree (sometimes proper binary tree or 2-tree or strictly binary tree)
is a tree in which every node other than the leaves has two children. A complete binary tree
is a binary tree in which every level, except possibly the last, is completely filled, and all
nodes are as far left as possible. A) is incorrect.
3. A Binary Tree can have
A. Can have 2 children
B. Can have 1 children
C. Can have 0 children
D. All of the above
View Answer
Ans : D
5.The difference between the external path length and the internal path
length of a binary tree with n internal nodes is?
A. 1
B. n
C. n + 1
D. 2n
View Answer
Ans : D
Explanation:The difference between the external path length and the internal path length of
a binary tree with n internal nodes is 2n.
Explanation: For an k-ary tree where each node has k children or no children, following
relation holds L = (k-1)*n + 1 Where L is the number of leaf nodes and n is the number of
internal nodes.
Explanation: Height of Height of a binary tree is MAX( Height of left Subtree, Height of right
subtree)+1.
Explanation: Splay trees can be used for faster access to recently accessed items and
hence used for cache implementations.
10. A weight-balanced tree is a binary tree in which for each node. The
number of nodes in the left sub tree is at least half and at most twice the
number of nodes in the right sub tree. The maximum possible height
(number of nodes on the path from the root to the farthest leaf) of such a
tree on n nodes is best described by which of the following?
A. log2 n
B. log4/3 n
C. log3 n
D. log3/2 n
View Answer
Ans : D
11) How are the elements with the same priority get processed according to the Priority Queue
mechanism?
12) Which linear structure has a provision of Last-In-First-Out (LIFO) mechanism for its elemen
a. Stack
b. Queue
c. Both a & b
d. None of the above
13) Which function plays an important role in returning the address of memory block allocated
locate / store a node especially while declaring ' top ' in the linked representation of the Stack?
a. galloc ()
b. falloc ()
c. malloc ()
d. calloc ()
ANSWER: malloc ()
15) Which step is associated with an initialization process while converting a recursive into no
recursive algorithm?
a. Declaration of Stack
b. Pushing of all local variables and parameters into the stack
c. Assigning the values of formal parameters
d. Popping of return address
ANSWER: Declaration of Stack
16) How do the nested calls of the function get managed?
a. Through Queues
b. Through Stacks
c. Through Trees
d. Through Graphs
ANSWER: Through Stacks
!
17) How many elements are present in the stack if the variable top exhibits pointing towards th
topmost element in the Array?
- Published on 28 Aug 15
a. top +1
b. top - 1
c. zero
d. infinite
ANSWER: top +1
18) What should be the growing direction of two stacks while implementing them in a similar a
as to reduce the overflow chances?
a. Forward
b. Backward
c. Opposite
d. None of the above
ANSWER: Opposite
Which is the correct algorithmic sequence for the conversion of an expression from Infix to Pr
A. Change of every '(' (opening bracket) by ')' (closing bracket) and vice-versa.
B. Reversal of an infix expression.
C. Conversion of the modified expression into postfix form.
D. Reversal of postfix expression.
- Published on 28 Aug 15
a. A, B, C, D
b. C, A, D, B
c. B ,A, C, D
d. D, B, A, C
ANSWER: B ,A, C, D
a. Left to Left
b. Right to Right
c. Left to Right
d. Right to Left
d. Cannot be predicted
24) What does the push operation top = top +1 indicate while representing the stack in one -
dimensional array?
- a. Stack Growing
b. Stack Shrinking
c. Stack Stability
d. Stack Instability
25) What happens if an expression tree reads the symbol in the form of an Operand?
a. One node tree is created and a pointer is pushed towards it on the stack.
b. Pointer is pop to two trees in order to generate a new tree with root as its operator.
c. Both a & b
ANSWER: One node tree is created and a pointer is pushed towards it on the stack.
26) Which of the following techniques represents the precise sequence of an In - Order Traver
Binary Tree?
ANSWER: Traverse Left Subtree, Visit the Root, Traverse Right Subtree
27) Which balance factor is stored in the new field introduced by an AVL tree for the represent
a node?
-
a. Length
b. Height
c. Width
d. Information
ANSWER: Height
c. Both a & b
29) Which value is assigned to leaf of game tree if the board position corresponds to the ' draw
result for the player?
-
a. 1
b. 0
c. -1
ANSWER: 0
30) Which is the correct sequential order of constructing a binary tree for the expression a + b
* e ?
a. A, B, C
b. B, C, A
c. B, A, C
d. C, A, B
ANSWER: C, A, B
PSEUDOCODE vs. CODE Characteristics of Good Pseudocode: + Shows the key concepts and the key
computation steps of the Algorithm, avoiding too much details. + Avoids dependency on any specific
prog. language. + Allows determining the correctness of the Algorithm. + Allows choosing a suitable
data-structures for an efficient implementation and complexity analysis.