It is not difficult to develop a divide-and-conquer algorithm checking whether a given array of size n
contains a majority element in O(nlogn) time. It is interesting to note that there is also a linear
time algorithm and it is also based on divide-and-conquer.