Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CODING LANGUAGE: MIPS Write a \"merge\" program that merges two ordered lists of

ID: 645360 • Letter: C

Question

CODING LANGUAGE: MIPS

Write a "merge" program that merges two ordered lists of integers into a new ordered list. For example, given two ordered lists (9,6,4,1) and (7,3,2,0) as input arguments, "merge" should produce a new list (9,7,6,4,3,2,1,0) which is also ordered. Another example could be to merge (6,0,-3) and (9,5,4,0,-2) to produce (9,6,5,4,0,0,-2,-3).

The "merge" program assumes that the two input lists (in decreasing order) of integers are stored in the data area. It loads the integers and merges them into an ordered list. The resulting ordered list (e.g. (9,6,5,4,0,0,-2,-3)) should be stored back into the data area. It is at your own choice how the data area (i.e. the lists) is arranged, and whether the resulting list is overwritten onto the original two lists. But be sure to give meaningful labels and clearly indicate (using label or comments) where the merged list is stored. Before your program terminates, it should print out the merged list which should be in decreasing order.

Do not use a sorting algorithm. Just compare the first number of each list and then put the bigger number in the final array, and keep doing this until the final array has both lists in descending order.

Explanation / Answer

hope it may helps you...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote