Question: IN MIPS PROCESSING LANGUAGE: A . Mergesort ( 1 0 0 % ) Convert merge in Project 2 into a subroutine. Write a main program
IN MIPS PROCESSING LANGUAGE:
A Mergesort
Convert "merge" in Project into a subroutine. Write a "main" program to perform
mergesorting of a list of integers by calling "merge" repeatedly. For example, if the
sorting program takes as input, it will produce a sorted list
The original unsorted list of integers should be received from the keyboard input. Your
program should first ask for user to input the number of integers in the original list, and
then ask for inputting all the integers. The total number of integers to be sorted by this
program should be a power of This means, the program should work with a list of
or integers but your program needs only to handle up to integers
The final sorted list in increasing order should be stored in the data area, that starts
with the label "list:". The sorted list should also be displayed on the screen console
You should not do this part by implementing a different sorting algorithm eg quick
sort You will receive if you do not make use of "merge", or if your sorted list is in
decreasing order.
HINTS: The bottomup approach of implementation without using recursion is to
initially sort the smallest possible sublists, and then merge every two neighboring sub
lists, until the whole list is merged and sorted. This nonrecursive approach is more
efficient in general, and is thus required for this assignment. An alternative is to sort
the list by dividing it into two sublists, recursively sorting the sublists, and then joining
the sublists together to give the sorted list. But this recursive approach is not required
in this assignment.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
