Question: IN PYTHON PLEASE Suppose you are building a first - person shooter game, where virtual zombies are climbing up a wall while the player, who

IN PYTHON PLEASE
Suppose you are building a first-person shooter game, where virtual zombies are climbing up a wall while the player, who is moving left and right in front of the wall, is trying to knock them down using various weapons. The position of each zombie is represented with a pair, (x,y) where x is the horizontal position of the zombie and y is its height on the wall. The player's position is specified with just a horizontal value, xp. One of the weapons that a player can use is a bomb, which kills the zombie that is highest on the wall from all those zombies within a given horizontal distance, r, of xp. Suppose the zombies are stored in a binary search tree, T, of height h, ordered in terms of their horizontal positions. Describe a method for augmenting T so as to answer maximum-zombie queries in O(h) time, where such a query is given by a range [xp - r, xp + r] and you need to return the coordinates of the zombie with maximum y-value whose horizontal position, x, is in this range. Describe the operations that must be done for inserting and deleting zombies as well as performing maximum-zombie queries.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!