Mascot Previous Years Solved Sample Placement Papers
- Minimum number of fields in each node of a doubly linked list is ____
a) 2
b) 3
c) 4
d) None of the above
Answer: b) 3 - A graph in which all vertices have equal degree is known as ____
a) Complete graph
b) Regular graph
c) Multi graph
d) Simple graph
Answer: a) Complete graph - A vertex of in-degree zero in a directed graph is called a/an ____
a) Root vertex
b) Isolated vertex
c) Sink
d) Articulation point
Answer: c) Sink - A graph is a tree if and only if graph is ____
a) Directed graph
b) Contains no cycles
c) Planar
d) Completely connected
Answer: b) Contains no cycles - The elements of a linked list are stored ____
a) In a structure
b) In an array
c) Anywhere the computer has space for them
d) In contiguous memory locations
Answer: c) Anywhere the computer has space for them - A parentheses checker program would be best implemented using ____
a) List
b) Queue
c) Stack
d) Any of the above
Answer: c) Stack - To perform level-order traversal on a binary tree, which of the following data structure will be required?
a) Hash table
b) Queue
c) Binary search tree
d) Stack
Answer: b) Queue - Which of the following data structure is required to convert arithmetic expression in infix to its equivalent postfix notation?
a) Queue
b) Linked list
c) Binary search tree
d) None of the above
Answer: d) None of the above - A binary tree in which all its levels except the last, have maximum numbers of nodes, and all the nodes in the last level have only one child, it will be its left child. Name the tree.
a) Threaded tree
b) Complete binary tree
c) M-way search tree
d) Full binary tree
Answer: b) Complete binary tree - Which of the following data structure is more appropriate for implementing quick sort iteratively?
a) Deque
b) Queue
c) Stack
d) Priority queue
Answer: c) Stack - The number of edges in a complete graph of n vertices is ____
a) n(n+1)/2
b) n(n-1)/2
c) n²/2
d) n
Answer: b) n(n-1)/2 - If two trees have the same structure but different node content, then they are called ____
a) Synonyms trees
b) Joint trees
c) Equivalent trees
d) Similar trees
Answer: d) Similar trees -
A static data member is given a value
A: Within the class definition
B: Outside the class definition
C: When the program is executed
D: Never
Ans: D -
In a class specifier, data or function designated private are accessible
A: To any function in the program
B: Only if you know the password
C: To member functions of that class
D: Only to public members of the class
Ans: C -
Which of the statements are true?
I. Function overloading is done at compile time.
II. Protected members are accessible to the member of derived class.
III. A derived class inherits constructors and destructors.
IV. A friend function can be called like a normal function.
V. Nested class is a derived class.
A: I, II, III
B: II, III, V
C: III, IV, V
D: I, II, IV
Ans: D -
Runtime polymorphism is achieved by
A: Friend function
B: Virtual function
C: Operator overloading
D: Function overloading
Ans: B -
Access to private data
A: Restricted to methods of the same class
B: Restricted to methods of other classes
C: Available to methods of the same class and other classes
D: Not an issue because the program will not compile
Ans: B -
Additional information sent when an exception is thrown may be placed in
A: The throw keyword
B: The function that caused the error
C: The catch block
D: An object of the exception class
Ans: C