the human player can perform certain attacks which damage all enemy players within a 5151920

The human player can perform certain attacks, which damage all enemy players within a certain range of the human player. To avoid the need to calculate with expensive multiplication and square root operations, we will approximate the range by a square situated about the human player.1
Specifically, given some fixed bound b, for which 0≤b≤M, if the human player is located at position(px, py) then all enemy players that lie within or on the borders of the box whose bottom-left corner is(px−b, py−b) and whose top-right corner is (px+b, py+b) are affected by the attack. depictsan example box for the bound b= 1.5.

Now, supposing the array has been sorted using your comparison function, implement an algorithm whose worst case complexity is in Θ(log(N)) that determines which array elements should be marked. Your function should take the bound b as an argument, and may also take the player’s coorinates (px, py)

"Get 15% discount on your first 3 orders with us"
Use the following coupon

Order Now