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 different types of sorting algorithms?

478


Explain what is B-tree?

556


What is 1d array?

464


Which data structure is applied when dealing with a recursive function?

603


What is heap tree in data structure?

490






Give a basic algorithm for searching a binary search tree?

494


What is garbage collection in data structure?

492


How to sort 1 million floating point numbers?

666


Which is better hashmap or treemap?

496


Does treeset allow duplicates?

457


What is a simple path?

531


What is circular queue in data structure?

453


Explain different methods in which you can traverse a tree?

527


State the demerit of linear representation of binary trees?

479


Which of the collections allows null as the key?

497