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 stack a dynamic data structure?
What is different between array and list?
Can a binary tree be empty?
How would you dynamically allocate a one-dimensional and two-dimensional array of integers?
How does a treemap sort?
Which is better stack or queue?
What are the properties of an algorithm?
What is adt example?
Which one is the simplest sorting in data structure?
Does set allow null values?
What does arraylist remove return?
If I try to add enum constants to a treeset, what sorting order will it use?
Are hash tables ordered?
What is bubble sort and selection sort?
Why linked list is required?