in Programming in C
1,061 views
2 votes
2 votes
In which of the cases shown below, Binary search can not always be applied for searching
(A) Hierarchical data record
(B) Internet Domain name conversion
(C) Searching a telephone number in directory
(D) An array of integers

Answer is given to be (D). I thought it must be (B).

 

Please help. I understand (D) is okay when the array is not sorted.But what about other options?

in Programming in C
1.1k views

4 Comments

How a query to resolve an IP address to a name will be handled with binary search.?
0
0
I think domain names arranged in a Hierarchy for example if its go.in   it first searches for in then it searches for go.

If first option is valid as per your reasoning with the same reason this is also valid :)
5
5
@hemanth_13-ohhhh. Nice reasoning. DNS records are always hierarchical and have unique names at each level.

Thanks hemanth :)
0
0

1 Answer

0 votes
0 votes
I am not sure about the option A,B,C but i am sure about the option D

there is two types of search on array of integers l

linear search

binary search

when array of integers are unsorted then we cannot apply binary search

Related questions