min max algorithm divide and conquer time complexity