- Create three arrays a1[100],a2[100],a3[200]
- Enter the elements p and q in ascending order in a1 and a2
- Initialize m and n(lower bound to 0)
- Check if(a[m]<=b[n])[Assign elements of array a1 to a3] a3[c]=a2[n+1]Set c= c+1Else[Assign elements of a2 to a3] a3[c]= a2[n++]Set c= c+1[End of If Structure]
- Assign remaining elements of a1 and a2 to a3
- Display the elements of a3
- End
Free C/C++ programs with output, C++, Programs C Programming Language, Object Oriented Programming (OOPs), C/C++ Programs Codes, C/C++ Program Shortcuts, History of C/C++ programming Language, C/C++ Programming Compilers……..!
Thursday, 18 July 2013
Algorithm for Merging Two Arrays
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment