Question: Please describe algorithm, give pseudocode, argue correctness and given best upper bound running time. 4. (30 points) You are given a line L that represents

Please describe algorithm, give pseudocode, argue correctness and given best upper bound running time.
4. (30 points) You are given a line L that represents a long hallway in an art gallery and a sorted set X = {21, 12,..., In} of real numbers that specify the positions of paintings in this hallway. Suppose that a guard can protect all the paintings within distance at most 1 of their position on both sides. Give an efficient algorithm that returns (a) the minimum number of guards to protect all the paintings; and (b) a placement of the guards that achieves this minimum number. 4. (30 points) You are given a line L that represents a long hallway in an art gallery and a sorted set X = {21, 12,..., In} of real numbers that specify the positions of paintings in this hallway. Suppose that a guard can protect all the paintings within distance at most 1 of their position on both sides. Give an efficient algorithm that returns (a) the minimum number of guards to protect all the paintings; and (b) a placement of the guards that achieves this minimum number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
