TCS
Company
Programming
Technical
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?
Read Solution (Total 4)
-
- 100
let us assume k be the element we need to search
then let array be n1,n2,n3..............n100
now to prove that the element searched is not there in the array we have to compare the element K with every element in the array.
So,totally we need 100 comparisons. - 9 years agoHelpfull: Yes(16) No(3)
- 100
Because we have to compare each element - 9 years agoHelpfull: Yes(11) No(2)
- 99
in order to compare n things those are not in a particular order, n-1 comparisions are necessary - 9 years agoHelpfull: Yes(1) No(18)
- It will take order of n times
- 6 years agoHelpfull: Yes(0) No(2)
TCS Other Question