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
What are the four characteristics of algorithms?
How to find the missing element in integer array of 1 to 7?
What is the difference between length () and size () of arraylist?
How to get a list of tables, views and columns in firebird database?
Is arraylist heterogeneous?
In tree construction which is the suitable efficient data structure?
Define linked list data structure.
When will you use array over arraylist?
Can we put null key in hashmap?
What are splay trees?
What is adt in data structure with example?
What is sort function?
Write an algorithm that counts number of nodes in the circular linked list
Why do we need sorting?
What are the types of data structures?