ALGORITHMS DESIGN AND AL AN A NALYSIS MCQS WITH ANSWERS SET 1 ALGORITHMS DESIGN DESIGN AND ANAL ANALYSI YSIS S MCQS WITH ANSWERS Algorithms Design And And Anl!sis Anl!sis MCQS "ith Ans"ers Ans"ers is minl! intended #ro GATE GATE s$irnts%These s$irnts%These &'estions (n lso (me in )te(h Com$'ter s(ien(e 'ni*ersit! e+ms nd *rio's inter*ie" #or (om$'ter s(ien(e st'dents
(01) Which of the following properties are necessary for an Algorithm? (A) Denite ness
(B) correct ness
(C) Eectieness
(D) A an! C
(0") which of the following techni#$e is not $sing for sole a 0%1&napsac& pro'lem (A) ree!y a'oe
(B) Dynamic programming
(C) 'ranch an! 'o$n!
(D) all of the
(0)*or the following program gies Big + analysis of the r$nning time (in terms of n) *or (i,0- i.n- i//) Ai , /(A) +(n%1)
(B) +(n)
(C) +(n")
(D) +(log n)
(02) *or the following program gies Big + analysis of the r$nning time (in terms of n) *or (i,0- i. n- i//) *or (3,i- 3. n- 3//) *or (&,3- &. n- &//) 4//(A) +(n%1) (B) +(n") (C) +(n) (D) +(log n) (05) *or the following program gies Big + analysis of the r$nning time (in terms of n) *or (i,0- i . n6n- i//) Ai , i(A) +(n%1)
(B) +(n")
(C) +(n)
(D) +(log n)
(07) ien f(n) , log "n8 g(n) , 9n which f$nction is asymptotically faster (A) f(n) is faster than g(n) (A) (B) g(n) is faster than f(n) (C) Either f(n) or g(n) (D) :either f(n) nor g(n) (0;) Which of the following are tr$e (a) n / 2n" , p (n ")
(') n< , +(nn)
(c) 10n"/ = , +(n")
(!) 7n >(log n /1)
, +(n) (A) a8' an! c
(B)a an! c
(C) a an! '
(D) all are tr$e
(0) n< , (A) +( "n) :one%
(B) @("n)
(C) A an! B
(D) +(n100)
(0=) (n) , (n>") / n "8 (1) , 1 then (n) , (A) (n")
(B) (n)
(C) (n2)
(D) (n)
(10) (n) , (n>2) / n then (n) , (A) + (n") (B) + (n) (C) + (n) (11) (n) , 2 (n>") / n then (n) , (A) (n")
(B) (n)
(C) (n2)
(D) + (n2) (D) (n)
(1") (n) , " (n>") / cn then (n) , (A) + (log n)
(C) + (n"log n)
(B) + (n log n)
(D) + (n")
(1) (n) , " (n>") / n " then (n) , (A) (n")
(B) (n)
(C) (n2)
(D) (n)
(12) (n) , " (n>") / n " then (n) , (A) + (n)
(B) + (n")
(C) + (n)
(D) + (n2)
(15) (n) , = (n>) / n then (n) , (A) (n2)
(B) (n)
(C) (n")
(D) (n)
Algorithms Design And Analysis MCQS with Answers' 1D 2A 3B 4C 5B 6A 7D 8C 9B 10C 11A
12B 13A 14B 15C
1. A directed graph is ………………. if there is a path from each erte! to eer" other erte! i# the digraph. A$ %ea&'" co##ected B$ (tro#g'" Co##ected C$ )ight'" Co##ected D$ *i#ear'" Co##ected
2. +# the …………….. traersa' ,e process a'' of a erte!-s desce#da#ts efore ,e moe to a# ad/ace#t erte!. A$ Depth irst B$ Breadth irst C$ %ith irst D$ Depth *imited
3. (tate )re of a'se. i$ et,or& is a graph that has ,eights or costs associated ,ith it. ii$ A# #directed graph ,hich co#tai#s #o c"c'es is ca''ed a forest. iii$ A graph is said to e comp'ete if there is #o edge et,ee# eer" pair of ertices. A$ )re a'se )re B$ )re )re a'se
C$ )re )re )re D$ a'se )re )re
4. atch the fo''o,i#g. a$ Comp'ete#ess i$ o, 'o#g does it ta&e to fi#d a so'tio# $ )ime Comp'e!it" ii$ o, mch memor" #eed to perform the search. c$ (pace Comp'e!it" iii$ +s the strateg" gara#teed to fi#d the so'tio# ,he# there i# o#e. A$ aiii ii ci B$ ai ii ciii C$ aiii i cii D$ ai iii cii
5. )he #mer of compariso#s do#e " see#tia' search is ……………… A$ 2$:1 B$ :1$2 C$ 1$2 D$ :2$2
6. +# …………… search start at the egi##i#g of the 'ist a#d chec& eer" e'eme#t i# the 'ist. A$ *i#ear search
B$ Bi#ar" search C$ ash (earch D$ Bi#ar" )ree search
7. (tate )re or a'se. i$ Bi#ar" search is sed for searchi#g i# a sorted arra". ii$ )he time comp'e!it" of i#ar" search is ;'og#$. A$ )re a'se B$ a'se )re C$ a'se a'se D$ )re )re
8. %hich of the fo''o,i#g is #ot the i#ter#a' sort< A$ +#sertio# (ort B$ B'e (ort C$ erge (ort D$ eap (ort
9. (tate )re or a'se. i$ A# #directed graph ,hich co#tai#s #o c"c'es is ca''ed forest. ii$ A graph is said to e comp'ete if there is a# edge et,ee# eer" pair of ertices.
A$ )re )re B$ a'se )re C$ a'se a'se D$ )re a'se
10. A graph is said to e ……………… if the ertices ca# e sp'it i#to t,o sets =1 a#d =2 sch there are #o edges et,ee# t,o ertices of =1 or t,o ertices of =2. A$ >artite B$ Bipartite C$ ?ooted D$ Bisects
11. +# a ee the i#itia' a'es of fro#t poi#ter f rare poi#ter r sho'd e …….. a#d ……….. respectie'". A$ 0 a#d 1 B$ 0 a#d 1 C$ 1 a#d 0 D$ 1 a#d 0
12. +# a circ'ar ee the a'e of r ,i'' e .. A$ r@r:1
B$ r@r:1$ EEF(+GE H 1I C$ r@r:1$ EEF(+GE D$ r@r1$ EEF(+GE
13. %hich of the fo''o,i#g stateme#t is tre< i$ si#g si#g'" 'i#&ed 'ists a#d circ'ar 'ist it is #ot possi'e to traerse the 'ist ac&,ards. ii$ )o fi#d the predecessor it is reired to traerse the 'ist from the first #ode i# case of si#g'" 'i#&ed 'ist. A$ io#'" B$ iio#'" C$ Both i a#d ii D$ o#e of oth
14. )he ada#tage of …………….. is that the" so'e the pro'em if see#tia' storage represe#tatio#. Bt disada#tage i# that is the" are see#tia' 'ists. A$ *ists B$ *i#&ed *ists C$ )rees D$ ees
15. %hat ,i'' e the a'e of top if there is a siJe of stac& ()ACKF(+GE is 5
A$ 5 B$ 6 C$ 4 D$ o#e
16. ………… is #ot the operatio# that ca# e performed o# ee. A$ +#sertio# B$ De'etio# C$ ?etriea' D$ )raersa'
17. )here is a# e!tra e'eme#t at the head of the 'ist ca''ed a ………. A$ A#ti#e' B$ (e#ti#e' C$ *ist header D$ *ist head
18. A graph is a co''ectio# of #odes ca''ed ………. A#d 'i#e segme#ts ca''ed arcs or ……….. that co##ect pair of #odes.
A$ ertices edges B$ edges ertices C$ ertices paths D$ graph #ode edges
19. A ……….. is a graph that has ,eights of costs associated ,ith its edges. A$ et,or& B$ %eighted graph C$ Both A a#d B D$ o#e A a#d B
20. +# ge#era' the i#ar" search method #eeds #o more tha# ……………. compariso#s. A$ 'og2#I1 B$ 'og#I:1 C$ 'og2#I D$ 'og2#I:1
Answers:
1. B$ (tro#g'" Co##ected
2. A$ Depth irst 3. B$ )re )re a'se 4. C$ aiii i cii 5. B$ :1$2 6. A$ *i#ear search 7. D$ )re )re 8. C$ erge (ort 9. A$ )re )re10. B$ Bipartite 11. B$ 0 a#d 1 12. C$ r@r:1$ EEF(+GE 13. C$ Both i a#d ii 14. B$ *i#&ed *ists 15. C$ 4 16. D$ )raersa' 17. B$ (e#ti#e' 18. A$ ertices edges 19. C$ Both A a#d B 20. D$ 'og2#I:1