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 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 is the height of binary tree?

946


What is difference between array and arraylist? When will you use array over arraylist?

934


Why using cookie to store session info is a better idea than just using session info in the request?

892


Which interfaces are implemented by linkedlist?

904


Which language is best for data structures?

920


what is traversal in linked lists?

1065


Is vector synchronized?

870


What method removes the value from the top of a stack?

923


Why it is important to have aligned addresses? What is the exception generated when there is a misaligned address?

853


How many pointers are necessary to implement a simple linked list?

1085


In what data structures are pointers applied?

947


Why sorting algorithms are important?

909


What is advantage and disadvantage of linked list?

819


What is data and data types?

878


an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].

947