show that this algorithm is suboptimalregardless of the choices for algorithms aband write program that reads points in plane and outputs any group of four or more colinear points ( points on the same linethe obvious brute-force algorithm requires ( time howeverthere is better algorithm that makes use of sorting and runs in ( log ntime show that the two smallest elements among can be found in log comparisons the following divide-and-conquer algorithm is proposed for finding the simultaneous maximum and minimumif there is one itemit is the maximum and minimumand if there are two itemsthen compare themand in one comparison you can find the maximum and minimum otherwisesplit the input into two halvesdivided as evenly as possibly (if is oddone of the two halves will have one more element than the otherrecursively find the maximum and minimum of each halfand then in two additional comparisons produce the maximum and minimum for the entire problem suppose is power of what is the exact number of comparisons used by this algorithmb suppose is of the form what is the exact number of comparisons used by this algorithmc modify the algorithm as followswhen is evenbut not divisible by foursplit the input into sizes of / and / what is the exact number of comparisons used by this algorithmsuppose we want to partition items into equal-sized groups of size /gsuch that the smallest / items are in group the next smallest / items are in group and so on the groups themselves do not have to be sorted for simplicityyou may assume that and are powers of two give an ( log galgorithm to solve this problem prove an ( log glower bound to solve this problem using comparison-based algorithms give linear-time algorithm to sort fractionseach of whose numerators and denominators are integers between and suppose arrays and are both sorted and both contain elements give an (log nalgorithm to find the median of suppose you have an array of elements containing only two distinct keystrue and false give an (nalgorithm to rearrange the list so that all false elements precede the true elements you may use only constant extra space suppose you have an array of elementscontaining three distinct keystruefalseand maybe give an (nalgorithm to rearrange the list so that all false elements precede maybe elementswhich in turn precede true elements you may use only constant extra space prove that any comparison-based algorithm to sort elements requires comparisons give an algorithm to sort elements in comparisons