Data Structures and Algorithms Multiple Choice Questions - Set 9

81.       The number of edges in a simple, n-vertex, complete graph is
(A) n*(n-2)
(B) n*(n-1)
(C) n*(n-1)/2
(D) n*(n-1)*(n-2)
Answer: C
82.       Match the following:
List - I
i. Bubble Sort  
ii. Shell Sort     
iii. Selection Sort        
List - II
a. Ο(n)
b. Ο(n2)
c. Ο(n log n)
(A) i → a,  ii → b,  iii → c
(B) i → b,  ii → c,  iii → a
(C) i → a,  ii → c,  iii → b
(D) i → b,  ii → a,  iii → c
Answer: B
83.       A double sub-scripted array declared as int a[ 3 ][ 5 ]; has how many elements?
(A) 15
(B) 13
(C) 10
(D) 8
Answer: A
84.       The largest and the second largest number from a set of n distinct numbers can be found in
(A) O(n)
(B) O(2n)
(C) O(n2)
(D) O(log n)
Answer: A
85.       To implement Sparse matrix dynamically, the following data structure is used
(A) Trees
(B) Graphs
(C) Priority Queues
(D) Linked List
Answer: D

86.       The depth dn, of complete binary tree of n nodes, where nodes are labelled from 1 to n with root as node 1 and last leaf node as node n is
Answer: C
87.       Which file open mode would be used to write data only to the end of an existing file?
(A) ios::app
(B) ios::in
(C) ios::out
(D) ios::trunc
Answer: A
88.       The balance factor for an AVL tree is either
(A) 0,1 or -1
(B) -2,-1 or 0
(C) 0,1 or 2
(D) All the above
Answer: A
89.       Tower of Hanoi is a classic example of ..............
(A) divide and conquer
(B) recursive approach
(C) (B) but not (A)
(D) Both (A) & (B)
Answer: D
90.    Which of the following searching techniques do not require the data to be in sorted form?
(A) Binary Search
(B) Interpolation Search
(C) Linear Search
(D) All of the above
Answer: C


Post a Comment

0 Comments