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 / wonder

Avarage number of comparision will be (N+1)/2(N-size of
array).
Because:If elements is in 1st position no of cpmparision
will be one and if the element is in the last position then
no of comparisions will be N.

Is This Answer Correct ?    31 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the four characteristics of algorithms?

468


How to find the missing element in integer array of 1 to 7?

522


What is the difference between length () and size () of arraylist?

445


How to get a list of tables, views and columns in firebird database?

472


Is arraylist heterogeneous?

493






In tree construction which is the suitable efficient data structure?

547


Define linked list data structure.

571


When will you use array over arraylist?

524


Can we put null key in hashmap?

483


What are splay trees?

576


What is adt in data structure with example?

511


What is sort function?

529


Write an algorithm that counts number of nodes in the circular linked list

493


Why do we need sorting?

472


What are the types of data structures?

530