MERGESORT(A,p,r)
MERGESORT(A,p,r)
{
if p < r
then q = ? (p+r) / 2?
MERGESORT(A,p,q)
MERGESORT(A,q+1,r)
MERGE(A,p,q,r)
}
When an algorithm contains a recursive
call to itself its running time can be
described by a recurrence equation or
recurrence
Previous slide
Back to first slide
View graphic version