Tampilkan postingan dengan label E-Book (How To Solve It By Computer) = Algorithm 5.1 The Two-Way Merge.. Tampilkan semua postingan
Tampilkan postingan dengan label E-Book (How To Solve It By Computer) = Algorithm 5.1 The Two-Way Merge.. Tampilkan semua postingan

Kamis, 12 Mei 2016

E-Book (How To Solve It By Computer) = Algorithm 5.1 The Two-Way Merge.

Asslamu'alaikum w.w.,

Pada Kesempatan ini saya akan memposting tentang : Algorithm 5.1 The Two-Way Merge. Ini merupakan dari Materi SEARCHING AND SORTING.

Algoritma :
        if a[m]<b[n] then a[m+1]:=b[n+1]:=a[m];
            i:=1;
            j:=1;
            nm:= n+m;
       for k:= 1 to nm dobegin {merge next element }
            if a[i]<b[j] thenbeginc[k]:=a[i];
                 i:=i+1end elsebeginc[k]:=b[j];
                 j:=j+1end
       end