divide and conquer approach algorithm