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
Which is the parent class of sortedset
Which is better bubble sort or selection sort?
What are the 4 types of data?
Define a tree?
Define balanced trees?
Is char array null terminated?
What is ascending and descending order?
Explain binary representation?
Does arraylist maintain insertion order?
Which is the parent class of printerstatereasons class?
Which sorting technique is best?
How many types of searching are there in data structure?
Define linked list data structure.
Is hashmap ordered?
Explain the most efficient method to reverse a linked list?