Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEEDS TO BE DONE IN MIPS(NOT JAVA/C++) (DOES NOT REQUIRE THE USER TO INPUT LISTS, THE LISTS CAN BE HARDCODED) Write a merge program that

NEEDS TO BE DONE IN MIPS(NOT JAVA/C++)

(DOES NOT REQUIRE THE USER TO INPUT LISTS, THE LISTS CAN BE HARDCODED)

Write a "merge" program that merges two ordered lists of integers into a new ordered list. For example, given two ordered lists (1,4,6,9) and (0,2,3,7) as input arguments, "merge" should produce a new list (0,1,2,3,4,6,7,9) which is also ordered. Another example could be to merge (-3,0,6) and (-2,0,4,5,9) to produce (- 3,-2,0,0,4,5,6,9). The "merge" program assumes that the two input lists (in increasing 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. (-3,-2,0,0,4,5,6,9)) 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 increasing order. Hints: You may refer to wikipedia entry of Merge Algorithm for the outline of the algorithm at https://en.wikipedia.org/wiki/Merge_algorithm.

I'm assuming after having the two input lists, I would use many if statements to determine what numbers are bigger and what numbers are smaller; afterwards I would print the sorted list by individually printing each number till finished with all of them.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain strong and weak atoms with examples.

Answered: 1 week ago

Question

Explain the alkaline nature of aqueous solution of making soda.

Answered: 1 week ago

Question

Comment on the pH value of lattice solutions of salts.

Answered: 1 week ago

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago