Question

***Please give comments and show it running*** Create a MIPS program that gets a set of...

***Please give comments and show it running***

Create a MIPS program that gets a set of numbers from the user, sorts them using selection sort, and displays the sorted numbers on the screen. You should create a subprogram to do the selection sort, sending it the length and address of the array.

This is the pseudo code for the structure the selection:

for (int i = 0; i < aLength-1; i++) {
    /* find the min element in the unsorted a[i .. aLength-1] */
    /* assume the min is the first element */
    int jMin = i;

    /* test against elements after i to find the smallest */
    for (int j = i+1; j < aLength; j++) {
        /* if this element is less, then it is the new minimum */
        if (a[j] < a[jMin]) {
            /* found new minimum; remember its index */
            jMin = j;
        }
    }
    if (jMin != i)
    {
        swap(a[i], a[jMin]);
    }
}

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
***Please give comments and show it running*** Create a MIPS program that gets a set of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT