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
What are splay trees?
Given an unsorted linked list, and without using a temporary buffer, write a method that will delete any duplicates from the linked list?
How do you sort large data?
How do you increase the capacity of an arraylist?
What is a node in it?
Mention the steps to insert data at the starting of a singly linked list?
What is indexing an array?
What is structure of data type?
What is non linear data structure with example?
State the different ways of representing expressions?
What is a comparator function?
What is hash data type?
Define balance factor of a node in avl tree?
Which sorting algorithm is the slowest?
Are collections thread safe?