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...

The element being searched for is not found in an array of
100 elements. What is the average number of comparisons
needed in a sequential search to determine that the element
is not there, if the elements are completely unordered?

Answer Posted / tarzan

Answer i think is

u require 1,2,3,...,100(max) to search an element because it
is unsorted
i assume it to be random seq of number so we hav to search
until we find the required no
so if all input ie search request is a hit then avg is
50.5=~51 (1+2+..+100/(2*100))
and if search has misses den worst is de case i.e mean will
shift towards 100 but always less than 100 bcoz it is
unrealistic to say de search is alwayz miss

Is This Answer Correct ?    24 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are splay trees?

953


Given an unsorted linked list, and without using a temporary buffer, write a method that will delete any duplicates from the linked list?

1011


How do you sort large data?

956


How do you increase the capacity of an arraylist?

935


What is a node in it?

928


Mention the steps to insert data at the starting of a singly linked list?

969


What is indexing an array?

1053


What is structure of data type?

887


What is non linear data structure with example?

943


State the different ways of representing expressions?

1208


What is a comparator function?

926


What is hash data type?

942


Define balance factor of a node in avl tree?

1042


Which sorting algorithm is the slowest?

854


Are collections thread safe?

837