Each of n distinct values is equally likely to be put into pile 1 or in pile 2, independent of each other. These piles are then sorted from smallest to largest. The two sorted piles are then merged into a single sorted pile by comparing the smallest values of each pile, putting  the smaller of these two into a new pile, and then repeating with the new smallest remaining values in each pile.Whenever one of the piles is empty, the remaining ones from the nonempty pile are then put into the merged pile in their sorted order.So the question is how to find the expected number of comparisons that are needed to merge the two sorted piles into a single sorted pile of all n items.Answer:-At most,Mergesort requires  number of comparisons < $n\log n$. But I want to know how it is computed when n is odd, using the two inequalities[1] $\log (x+1)\leq\log(x)+1$[2]$\log(x+\frac12)+\log(x-\frac12)\leq 2log(x)$
Analyzing a sorting algorithm
algorithm analysis;runtime analysis;sorting