HP 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