Data structure/Sweeping Idea