What is the average number of comparisons needed in a
sequential search to determine the position of an element in
an array of 100 elements, if the elements are ordered from
largest to smallest?
Answer Posted / sherin
its asked sequential search
if it was binary then dividing array into 2 , then
comparing....100 - 50 - 25 - 12 - 6 - 3 - 1 -then the no.,
i think Dj thought it like that ..
Sequential search is not needed here because the numbers are
ordered , if it was not ordered then 'n' comparisons are
necessary.
question here is not worst case scenario , see its asked
average case ..that too with ordered numbers ...
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
On clicking a node in a tree, all the adjacent edges are turned on. Calculate min of clicks such that all the edges are turned on.
What are linear and non linear data structures?
Explain what is B-tree?
What is impact of signed numbers on the memory using data structures?
Define a binary tree?
Define in brief an array.
What you mean by sorting?
Which language is best for learning data structures and algorithms?
What are the disadvantages of linear list?
State the different ways of representing expressions?
Is char array null terminated?
What is a node in it?
What do you mean by 2-3-4 tree?
Explain Stack
What is meant by arraylist?