TY - JOUR
T1 - Average merge time
T2 - An intuitive interpretation
AU - O'Keeffe, M.
AU - Schellekens, M.
PY - 2003/10
Y1 - 2003/10
N2 - A classical result by Nagler ([1]) states that the average comparison time of the standard merge algorithm over merge pairs of size n, i.e. pairs of sorted lists of size n, is: T̄M(n,n) = 2n2/n+1 Nagler's proof sheds little light on the intuition which should be given to this quotient. We provide an intuitive interpretation of Nagler's result, based on the notion of an "alternation". This notion essentially represents a switch between the two lists in mergings "pop-the-top" process. We recall from ([2]) that the average number of alternations over all possible merge pairs of size n is n and provide a simplified proof of this fact. We show that the set of all merge pairs of size n which have exactly the average number of alternations turns out to be a "representative" of the entire set of merge pairs in the following sense: the average comparison time over all merge pairs, i.e. T̄M(n,n), is identical to the time T̄M[n,n] which merge takes when restricted to merge pairs which have exactly n alternations, i.e. merge pairs which have exactly the average number of alternations. Finally, we show that the average time, T̄M[n,n] = 2n2/n-1, can be expressed intuitively as the product of the average number of alternations by the average number of comparisons that occur between alternations.
AB - A classical result by Nagler ([1]) states that the average comparison time of the standard merge algorithm over merge pairs of size n, i.e. pairs of sorted lists of size n, is: T̄M(n,n) = 2n2/n+1 Nagler's proof sheds little light on the intuition which should be given to this quotient. We provide an intuitive interpretation of Nagler's result, based on the notion of an "alternation". This notion essentially represents a switch between the two lists in mergings "pop-the-top" process. We recall from ([2]) that the average number of alternations over all possible merge pairs of size n is n and provide a simplified proof of this fact. We show that the set of all merge pairs of size n which have exactly the average number of alternations turns out to be a "representative" of the entire set of merge pairs in the following sense: the average comparison time over all merge pairs, i.e. T̄M(n,n), is identical to the time T̄M[n,n] which merge takes when restricted to merge pairs which have exactly n alternations, i.e. merge pairs which have exactly the average number of alternations. Finally, we show that the average time, T̄M[n,n] = 2n2/n-1, can be expressed intuitively as the product of the average number of alternations by the average number of comparisons that occur between alternations.
UR - https://www.scopus.com/pages/publications/23844460961
M3 - Article
AN - SCOPUS:23844460961
SN - 1571-0661
VL - 74
SP - 123
EP - 134
JO - Electronic Notes in Theoretical Computer Science
JF - Electronic Notes in Theoretical Computer Science
ER -