Escolar Documentos
Profissional Documentos
Cultura Documentos
nd
comparison gives 11 and $
rd
$.
1.<hat kind of search is used in a telephone directory=
a.&inear search
b.Binary search
c.Aashing
d.none
Ans:b
. <hich of the follo"ing statements is6are incorrect in connection "ith the binary
search algorithm=
/a0 !he most efficient method of searching a sequential table "ithout the use of au#iliary
indices or tables is the binary search algorithm.
/b0 Basically9 the argument is compared "ith the key of the middle element of the table.
8f they are equal9 the search is successful; other"ise9 either the upper half or the lo"er
half of the table must be searched in a similar manner.
/c0 Any kind of data set can be used.
/d0 !ime comple#ity is . /n log n0.
Ans: c
$. Binary search algorithm "orks best "ith
a0 Arrays
b0 trees
c0 Binary Search trees
d0 None
Ans:c
'. <hat additional requirement is placed on an array9 so that binary search may be
used to locate an entry=
A. !he array elements must form a heap.
B. !he array must have at least entries.
>. !he array must be sorted.
,. !he arrayBs size must be a po"er of t"o.
Ans:c
(. <hat is the "orst3case time for serial search finding a single item in an array=
A. >onstant time
B. &ogarithmic time
>. &inear time
,. Cuadratic time
Ans:c
). 8f there are 1+ elements in an array9 ho" many ma#imum comparisons are required to
search an element using binary search=
a.$ b.' c.( d.)
Ans:c
+.8f there are $' elements in an array9 ho" many ma#imum comparisons are required to
search an element using binary search=
a.$ b.' c.( d.)
Ans:d