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
Is there any difference between int[] a and int a[]?
What is mean by sorting?
What is data type explain?
How do you find the time complexity of a bubble sort?
Explain binary search tree?
What is the difference between 1d and 2d array?
What are the properties of binary tree?
What do you mean by open addressing?
Which is faster hashmap or linkedhashmap?
What is queue example?
What is the difference between hashset and linkedhashset?
What is the difference between hashset and hashmap?
Why do we need a data structure?
How will you reverse Linked List.
What is the difference between data types and data structures?