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
What is a string array?
What is bubble sort and selection sort?
What is Doubly link list?
Which is faster arraylist or linked list?
Is it possible to increase size of array?
Define linear data structures?
What is adt example?
Describe the types of data structures?
What is the difference between Array and LinkedList?
What is the advantage of the heap over a stack?
What is meant by int?
Can you sort a hashmap?
What is the difference between hashset and treeset?
What is thread and types of thread?
Why is quicksort better than mergesort?