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

Which is better bubble sort or selection sort?

612


Explain what are the major data structures used in the hierarchical data model?

720


How to find the missing element in integer array of 1 to 7?

698


How does a dynamic array work?

623


What are the goals of data structure?

927


What is the use of hashtable?

644


What is a 2 dimensional array?

723


Which sorting is best?

655


what is traversal in linked lists?

756


Is arraylist a class?

634


How does hashset work internally in java?

697


How do I remove a value from a list?

603


What is sequential sorting?

674


Run time memory allocation is known as ?

742


What is selection sort with example?

764