Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / vivek tiwari

f(n)= 1.Pn + 2.Pn + 3.Pn +...+ N.Pn
where
Pn = 1/N
f(n)= 1.1/N +2.1/N + 3.1/N+....+N.1/N
= (1+2+3+....+N)1/N
= N(N+1)/2N
= (N+1)/2

Is This Answer Correct ?    47 Yes 1 No

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

Answer / shyam

..............
(n+1)/2
.............

Is This Answer Correct ?    11 Yes 1 No

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

Answer / bipin from utkal university mc

suppose there are five element 23,56,78,12,90
minimum time require means searching element present at
first so it takes only one comparison
maximum time require means searching element present at
last so it takes n No. of comparison(here 5 )

so avarage comarison=(1+n)/2

Is This Answer Correct ?    10 Yes 1 No

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

Answer / 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

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

Answer / pavan

n/2(if array contains n elements)

Is This Answer Correct ?    5 Yes 25 No

Post New Answer

More Data Structures Interview Questions

List the limitations of linear probing?

0 Answers  


What are the drawbacks of array implementation of queue?

0 Answers  


What is time complexity of sorting algorithms?

0 Answers  


What is rule regarding overriding equals and hascode method?

0 Answers  


What is the use of space complexity and time complexity?

0 Answers  


Does hashset allow duplicates?

0 Answers  


Name a few tree data structure application.

1 Answers   Accenture,


List all data structures you would use for a memory management module.

0 Answers   HPCL, Hughes Systique Corporation, ITC Indian Tobacco Company,


Can you store different types in an array?

0 Answers  


Explain circular linked list?

0 Answers  


What is the need for extendible hashing?

0 Answers  


How do you find the space complexity of a bubble sort?

0 Answers  


Categories