merge sort algorithm explianed, Lecture notes of Algorithms and Programming

A brief description merge sort algorithm

Typology: Lecture notes

2019/2020

Uploaded on 02/05/2020

bonbangla
bonbangla 🇧🇩

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1

Partial preview of the text

Download merge sort algorithm explianed and more Lecture notes Algorithms and Programming in PDF only on Docsity!

MERGE(A, p, g,r) nm <—q-—ptl nz <-r—@q create arrays L[1..n, + 1] and R[1..n2+ 1) fori < 1ton, do L{i] < A[p+i-1] for j < ltong do R[j] — Alg+ J] L[n, + 1) < co R[nz +1) < co 10 i<1 ll jl 12 fork — ptor 13 do if L[i] < R[j] 14 then A[k] <— L[f] 15 i