What is the average number of comparisons in a sequential
search?

Answer Posted / kalyani

Searching an element in an array, the search starts from the first element till the last element the average number of comparisons in a sequential search is (N+1)/2,where N is the size. The number of comparisons will be 1, if element is in the first position and if element is in the last position the number of comparisons will be N.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you find a string is anagram or not?

479


How do arrays work?

512


What is push and pop in stack?

419


What is the difference between arrays sort and collections sort?

440


What do you mean by overflow and underflow?

544






What are the goals of data structure?

702


What is the Insertion Sort Code?.

635


Is list an array?

444


Write a program for reversing the Single Linked List?

731


Can a class have a constructor?

512


How do you initialize an arraylist?

494


What should be done in the base case for this recursive problem?

504


Why it is said that searching a node in a binary search tree is efficient than that of a simple binary tree?

611


What is binary search tree and explain its time complexity?

516


What is nsmutablearray?

463