R4RIN
Articles
Java 8
MCQS
Data structure MCQ Quiz Hub
Data Structure Multiple Choice Questions and Answers
Choose a topic to test your knowledge and improve your Data structure skills
1. Which data structure allows deleting data elements from front and inserting at the rear?
Stacks
Queues
Deques
Binary search tree
2. Identify the data structure which allows deletions at both ends of the list but insertion at only one ending.
Input-restricted deque
Output-restricted deque
Priority Queues
None of the above
3. Which of the following data structure is non-linear type?
Strings
Lists
Stacks
None of the above
4. Which of the following data structure is a linear type?
Strings
Lists
Queues
All of the above
5. To represent the hierarchical relationship between elements, which data structure is suitable?
Deque
Priority
Tree
All of the above
6. The depth of a complete binary tree is given by
Dn = n log2n
Dn = n log2n+1
Dn = log2n
Dn = log2n+1
7. When representing an algebraic expression E which uses only binary operations in a 2-tree,
When representing an algebraic expression E which uses only binary operations in a 2-tree,
the operations in E will appear as external nodes and variables in internal nodes
the variables and operations in E will appear only in internal nodes
the variables and operations in E will appear only in external nodes
8. A binary tree can easily be converted into q 2-tree
by replacing each empty subtree by a new internal node
by inserting an internal node for non-empty node
by inserting an external node for non-empty node
by replacing each empty subtree by a new external node
9. A binary tree can easily be converted into q 2-tree
by replacing each empty subtree by a new internal node
by inserting an internal node for non-empty node
by inserting an external node for non-empty node
by replacing each empty subtree by a new external node
10. When converting a binary tree into an extended binary tree, all the original nodes in the binary tree are
internal nodes on extended tree
external nodes on extended tree
vanished on extended tree
None of the above
11. The post-order traversal of a binary tree is DEBFCA. Find out the pre-order traversal
ABFCDE
ADBFEC
ABDECF
ABDCEF
12. Which of the following sorting algorithm is of divide-and-conquer type?
Bubble sort
Insertion sort
Quicksort
All of the above
13. An algorithm that calls itself directly or indirectly is known as
Sub-algorithm
Recursion
Polish notation
Traversal algorithm
14. In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency. These special pointers are called
Leaf
branch
path
thread
15. The in order traversal of the tree will yield a sorted listing of elements of tree in
Binary trees
Binary search trees
Heaps
None of the above
16. In a Heap tree
Values in a node are greater than every value in the left subtree and smaller than right subtree
Values in a node are greater than every value in children of it
Both of the above conditions apply
None of the above conditions applies
17. In a graph, if e=[u, v], Then u and v are called
endpoints of e
adjacent nodes
neighbors
All of the above
18. A connected graph T without any cycles is called
a tree graph
free tree
a tree
All of the above
19. In a graph, if e=(u, v) means
u is adjacent to v but v is not adjacent to u
e begins at u and ends at v
u is processor and v is a successor
both b and c
20. . If every node u in G is adjacent to every other node v in G, A graph is said to be
isolated
complete
finite
strongly connected
21. Two main measures for the efficiency of an algorithm are
Processor and memory
Complexity and capacity
Time and space
Data and space
22. The time factor when determining the efficiency of the algorithm is measured by
Counting microseconds
Counting the number of key operations
Counting the number of statements
Counting the kilobytes of algorithm
23. The space factor when determining the efficiency of the algorithm is measured by
Counting the maximum memory needed by the algorithm
Counting the minimum memory needed by the algorithm
Counting the average memory needed by the algorithm
Counting the maximum disk space needed by the algorithm
24. The space factor when determining the efficiency of the algorithm is measured by
Counting the maximum memory needed by the algorithm
Counting the minimum memory needed by the algorithm
Counting the average memory needed by the algorithm
Counting the maximum disk space needed by the algorithm
25. Which of the following case does not exist in complexity theory
Best case
Worst case
Average case
Null case
26. The Worst case occur in the linear search algorithm when
Item is somewhere in the middle of the array
Item is not in the array at all
Item is the last element in the array
Item is the last element in the array or is not there at all
27. The Average case occur in the linear search algorithm
When Item is somewhere in the middle of the array
When Item is not in the array at all
When Item is the last element in the array
When Item is the last element in the array or is not there at all
28. The complexity of the average case of an algorithm is
Much more complicated to analyze than that of a worst case
Much simpler to analyze than that of the worst case
Sometimes more complicated and some other times simpler than that of the worst case
None of the above
29. The complexity of the linear search algorithm is
O(n)
O(log n)
O(n2)
O(n log n)
30. The complexity of Binary search algorithm is
O(n)
O(log )
O(n2)
O(n log n)
31. The complexity of Bubble sort algorithm is
O(n)
O(log n)
O(n2)
O(n log n)
32. In a Stack, the command to access an nth element from the top of the stack s will be
S[Top-n]
S [Top+n]
S [top-n-1]
None of the above
33. If yyy, xxx and zzz are the elements of a lexically ordered binary tree, then in pre-order traversal which node will be traverse first
xxx
yyy
zzz
cannot be determined
34. In a balanced binary tree, the height of two subtrees of every node can not differ by more than
2
1
9
3
35. The result of eval u at ing prefix expression */b+-dacd, where a = 3, b = 6, c = 1, d = 5 is
0
5
10
15
36. In an array rep re sensation of the binary tree, the right child of the root will be at the location of
2
5
3
0
37. The total number of comparisons in a bubble sort is
O(n log n)
O(2n)
O(n2)
None of the above
38. The dummy header in the linked list contains
First record of the actual data
Last record of the actual data
Pointer to the last record of the actual data
None of the above
39. Write the output of the fol low ing program: int a[] = {1,2,3}*P;
3
Junk value
Run time error
Address of the third element
40. If the out-degree of every node is exactly equal to M or 0 and the number of nodes at level K is Mk-1 [con sider root at level 1], the tree is called as(i) Full m-ary try (ii) Complete m-ary tree (iii)Positional m-ary tree
Only (i)
Only (ii)
Both (i) and (ii)
Both (ii) and (III)
Submit