Merge Sort, Assembly Language

Write a program to merge two sorted arrays to create a third sorted array containing all values from the two original arrays.

Merge is a key component to the mergesort algorithm. Suppose we have two sorted array A and B. We want to create array C which contains all values from A and B, in sorted order. Merge looks at one element from each of A and B, and puts the smaller one into array C. When all elements of A or B have been copied into C, the remaining elements from the other array are copied into C.

The pseudocode for merge is:

while more elements in A and more elements in B { if curr element in A < curr element in B copy curr element in A to next position in C else copy curr element in B to next position in C } while more elements in A { copy all remaining elements in A to C } while more elements in B { copy all remaining elements in B to C }

Hint: Think carefully about the subscripts you need for the three arrays.

Prompt the user and read 7 numbers into A. Make sure the values are in order.

Prompt the user and read 5 numbers into B. Make sure the values are in order.

Merge these two arrays to create the array C.

Print the array C.
Posted Date: 12/8/2013 9:31:47 PM | Location : United States

Related Discussions:- Merge Sort, Assignment Help, Ask Question on Merge Sort, Get Answer, Expert's Help, Merge Sort Discussions

Write discussion on Merge Sort
Your posts are moderated
Related Questions
MyLocation SDWORD 14 TheTest        SDWORD 8     mov    eax,MyLocation     mov    ebx,TheTest     neg     eax,ebx     sub     eax,ebx Show exactly what lives in eax after executi

#question.flow chart for a program to find out the number of even and odd numbers from a given series of 16-bit hexadecimal numbers.

can u please give me ideas on Assembly Language Projects using Nasm

8086 Minimum mode System and Timing In a minimum mode 8086 system, the microprocessor 8086 is operated in minimum mode by strapping its MN/MX pin to logic 1.All the control si

EVOLUTION OF MICROPROCESSOR : The digital circuits and systems may be broken into two part: 1) Sequential Circuit and 2) Combinational Circuits     Norm

Please let me know if you can do an assignment in the next 12 hours

AAM: ASCII Adjust for Multiplication after execution. This instruction converts the product available in the AL into unpacked BCD format.  This follows a multiplication   instruct

Declare 1 constant. This can be done just below the prototype section. Put the following divider above the constant section. ;************************ Constants ****************

program to find negative and positive integers from given signed numbers with output and explanation of every instructions.

SCAS : Scan String Byte or String Word:- This instruction scans a string of words or byte for an operand word or byte specified in the register AL or  register AX. The string i