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 different types of sorting algorithms?
Explain what is B-tree?
What is 1d array?
Which data structure is applied when dealing with a recursive function?
What is heap tree in data structure?
Give a basic algorithm for searching a binary search tree?
What is garbage collection in data structure?
How to sort 1 million floating point numbers?
Which is better hashmap or treemap?
Does treeset allow duplicates?
What is a simple path?
What is circular queue in data structure?
Explain different methods in which you can traverse a tree?
State the demerit of linear representation of binary trees?
Which of the collections allows null as the key?