Data Structures and Algorithms Multiple Choice Questions - Set 15

141.       A sorting technique which uses the binary tree concept such that label of any node is larger than all the labels in the subtrees, is called ................
(A) Selection sort
(B) Insertion sort
(C) Heap sort
(D) Quick sort
Answer: C
A Sorting technique which uses the binary tree concept such that label of any node is larger than all the, labels in the sub trees, is called Heap sort because heap sort works on a complete binary tree with the property that the value at any node 'N' of the tree should be greater than or equal to the value at all its children nodes.
142.       A balance factor in AVL tree is used to check ..................
(A) what rotation to make.
(B) if all child nodes are at same level.
(C) when the last rotation occurred.
(D) if the tree is unbalanced.
Answer: D
143.       A full binary tree with 'n' non-leaf nodes contains ..............
(A) log2 n nodes
(B) n+1 nodes
(C) 2n nodes
(D) 2n+l nodes
Answer: D
144.       A graph 'G' with 'n' nodes is bipartite if it contains .............
(A) n edges
(B) a cycle of odd length
(C) no cycle of odd length
(D) n2 edges
Answer: C
145.       Recursive procedures are implemented by using .................... data structure.
(A) queues
(B) stacks
(C) linked lists
(D) strings
Answer: B
Recursive procedures are implemented by using stacks because stacks are LIFO data structure and we need this feature to store return addresses of various recursive calls in recursive procedures.

146.       Which one of the below is not divide and conquer approach?
(A) Insertion Sort
(B) Merge Sort
(C) Shell Sort
(D) Heap Sort
Answer: B
147.       Which of the following is not a sequence container provided by the STL?
(A) vector
(B) array
(C) list
(D) deque
Answer: B
148.       Quick sort algorithm is an example of .............
(A) Greedy approach
(B) Improved binary search
(C) Dynamic Programming
(D) Divide and conquer
Answer: D
149.       In ............., the difference between the height of the left sub tree and height of the right tree, for each node, is almost one.
(A) Binary search tree
(B) AVL - tree
(C) Complete tree
(D) Threaded binary tree
Answer: B
150.    In C programming, when we remove an item from bottom of the stack, then:
(A) The stack will fall down.
(B) Stack will rearrange items.
(C) It will convert to LIFO
(D) This operation is not allowed.
Answer: D

Post a Comment