Saturday, October 27, 2007

Algorithms Interview Question Part 8


83. An algorithm designed for a computer which executes one instruction at a time is called
a.Serial algorithm
b.Parallel algorithm
c.Random algorithm
d.Deterministic algorithm
84. Algorithms, which take advantage of computer architectures where several processors can work on a problem at the same time are called
a.Serial algorithm
b.Parallel algorithm
c.Random algorithm
d.Deterministic algorithm
Ans:b
85. Serial algorithms divide the problem into more symmetrical or asymmetrical sub problems and pass them to many processors and put the results back together at one end.(T/F)
Ans:False
86.The resource consumption in parallel algorithms is
i.processor cycles on each processors ii.the communication overhead between the processors.
a.only I b.only ii c.i and ii d.neither I nor ii
Ans:c
87.Sorting algorithms can be parallelized efficiently, but their communication overhead is expensive.(T/F)
Ans:True
88.Recursive algorithms are not parallelizable. (T/F)
Ans:False


89. The Order of the expression : 5*2n-n*log(n)-3*n3-1 is________.
a. O(n3)
b. O(n*log(n))
c. O(2n)
d. O(n*log(n))
Ans:c





90. Which of the following Orders of algorithm is considered efficient ?
a. O (n * log (n))
b. O(2n)
c. O(n2)
d.O (log (n))
Ans:d

91. Which one depicts the correct order of efficiency from best to worst among the following ?
a. O(n*n) , O(2n), O(log(n)), O(n)
b. O(n*n)O(n),O(2n),O(log(n)
c. O(log(n)), O(n), O(n*n), O(2n )
d. O(n*n), O(2n), O(log(n)), O(n)
Ans:c



92. (A) In O(n*log(n)), multiplying the file size by 100 will multiply the sorting time by less than 200. (B) In O(n*n), multiplying the file size by 100 will multiply the sorting time by a factor of 10000. What is correct about above statements?
a.A is TRUE, B is FALSE
b. B is TRUE, A is FALSE
c. Both are TRUE
d. Both are FALSE
Ans:c

Nlog n=100log100 < 200
100*100=10000

0 comments:

Advertisement

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com