Data Structures and Algorithms Multiple Choice Questions - Set 20

191.       An undirected graph G with n vertices and e edges is represented by adjacency list. What is the time required to generate all the connected components?
(A) O(n)
(B) O(e)
(C) O(e+n)
(D) O(e2)
Answer: C
192.       A stable sorting algorithm:
(A) does not crash.
(B) does not run out of memory.
(C) does not change the sequence of appearance of elements.
(D) does not exists.
Answer: C
193.       Consider a linked list of n elements. What is the time taken to insert an element after an element pointed by some pointer?
(A) O(1)
(B) O(log2 n)
(C) O(n)
(D) O(n log2 n)
Answer: A
194.       How many pointers are contained as data members in the nodes of a circular, doubly linked list of integers with five nodes?
(A) 5
(B) 8
(C) 10
(D) 15
Answer: C
195.       The smallest element of an array’s index is called its
(A) lower bound
(B) upper bound
(C) range
(D) extraction
Answer: A
196.       In a circular linked list:
(A) components are all linked together in some sequential manner.
(B) there is no beginning and no end.
(C) components are arranged hierarchically.
(D) forward and backward traversal within the list is permitted.
Answer: B
197.       What is the worst case run-time complexity of binary search algorithm?
(A) Ο(n2)
(B) Ο(nlog n)
(C) Ο(n3)
(D) Ο(n)
Answer: D
198.       A graph with n vertices will definitely have a parallel edge or self loop of the total number of edges are ..............
(A) more than n
(B) more than n+1
(C) more than (n+1)/2
(D) more than n(n-1)/2
Answer: D
199.       Interpolation search is an improved variant of binary search. It is necessary for this search algorithm to work that:
(A) data collection should be in sorted form and equally distributed.
(B) data collection should be in sorted form and but not equally distributed.
(C) data collection should be equally distributed but not sorted.
(D) None of these.
Answer: A
200.    The minimum number of multiplications and additions required to evaluate the polynomial
P = 4x3+3x2-15x+45 is
(A) 6 & 3
(B) 4 & 2
(C) 3 & 3
(D) 8 & 3
Answer: C


Post a Comment

0 Comments