You are given list of points appearing and disappearing dynamically on the screen.
Write an algorithm to compute minimum bounded box.
Solved using maps and set. overall time complexity is O(logN) and space complexity is O(n). Could not improve the complexity further. Apparanlty, there was a bug in my code which i could not figure out.
Edit:
Can this problem be solved using segment trees? (I do not know about segment trees)
Solution of minumum bounded box is find lowest and highest (x,y) values.
so, if points are:
(-1,1) (0,0), (4,5), (5,1)
bounded box is:
(-1,0) and (5,5)