title: How to detect two moving shapes overlapped ? (Algorithm)
body: <p>Given a list of circles with its coordinates (x and y) that are moving every second in different direction (South-East, South-West, North-East and North-West), and the circle will change direction if it hits the wall sort of like bouncing, so how do we detect if any of them collide or overlap with each other ? I am not sure if we can use some data structures like a <code>Binary Search Tree</code> because since all the coordinates  vary every seconds, so the tree will have to re-build accordingly. Or can we use <a href="http://en.wikipedia.org/wiki/Fortune%27s_algorithm" rel="nofollow">Vertical Sweep Line Algorithm</a> each time ? Any ideas on how to do this in a efficient way ? </p>