Some Basic Algorithms always help you to solve the complex problems...