Data Structures And Algorithms Mcqs
Q.1: Consider a linked list implementation of a queue with two pointers: front and rear. The time needed to insert element in a queue of length n is:
A. O(1)
B. O(log2n)
C. O(n)
D. O(n*log2n)
Q.2: If X is the adjacency matrix of a graph G with no self loops, the entries along the principle diagonal of X are ______.w
A. all zeros
B. all ones
C. both zeros and ones
D. different
Q.3: What is true of the complete bipartite graphs K(3,3) and K(2,4)?@
A. Both are planar
B. Neither is a planar
C. Both are isomorphic
D. None of these
Q.4: What is the minimum number of nodes in a complete binary tree with depth 3?K
A. 4
B. 8
C. 11
D. 15
Q.5: Which term is used to describe an O(n) algorithm?1
A. Constant
B. Linear
C. Logarithmic
D. Quadratic
Q.6: Where does the push member function place the new entry on the linked list in the linked list implementation of a queue?x
A. At the head
B. At the tail
C. After all other entries that are greater than the new entry;
D. After all other entries that are smaller than the new entry;
Q.7: Using which traversal in a sorted binary insertion tree can a sorted array of numbers be obtained?b
A. Pre-order traversal
B. Post-order traversal
C. In order traversal
D. Top-down traversal
Q.8: One difference between a queue and a stack is:.
A. Queues require dynamic memory but stacks do not/
B. Stacks require dynamic memory but queues do not/
C. Queues use two ends of the structure but stacks use only one >
D. Stacks use two ends of the structure but queues use only one<
Q.9: The post-order traversal of a binary tree starts with:6
A. Post-order traversal of the left sub tree ,
B. Post-order traversal of the right sub tree*
C. Post-order traversal of the root
D. Post-order traversal of the lowest node'
Q.10: Which situation occurs frequently if the selected hash function is poor?H
A. Overflow
B. Underflow
C. Collision
D. None of the above

Related Mcqs

All Subject Mcqs