[Adobe]Locating a tower
Given a city in form of a square. There are various cell towers located at various points in the square city (say (x,y)). The distribution
of towers is totally random. Now given an (x,y) point, design a data structure that will help you tell whether the cell tower is present at that
location or not.(of course optimal)
of towers is totally random. Now given an (x,y) point, design a data structure that will help you tell whether the cell tower is present at that
location or not.(of course optimal)
Use Quad tree.
ReplyDeleteCan we use a 2-D Matrix?
ReplyDeleteCorresponding M[x][y] is 1 if tower is present otherwise the entry is zero.