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


Please Help Members By Posting Answers For Below Questions

Which collection is used for sort?

494


How do stacks work?

505


What is ordered map?

486


What data type is array?

486


What is the time complexity of hashmap get () and put () method?

452






Mention for which header list, you will found the last node contains the null pointer?

492


What is a postfix expression?

561


How efficient is bubble sort?

499


What is a B tree?

585


What is the best sorting technique?

479


What is data structure what is need of it?

476


Why is quicksort unstable?

500


Why merge sort is better than insertion sort?

471


Explain what is the bucket size, when the overlapping and collision occur at same time?

572


Why is hashset not ordered?

495