Question: Convert this code in Java to MIPS 32 also put comments specific the code : public class LargestInArrayExample{ public static int getLargest(int[] a, int total){

Convert this code in Java to MIPS 32 also put comments specific the code :

public class LargestInArrayExample{

public static int getLargest(int[] a, int total){

int temp;

for (int i = 0; i < total; i++)

{

for (int j = i + 1; j < total; j++)

{

if (a[i] > a[j])

{

temp = a[i];

a[i] = a[j];

a[j] = temp;

}

}

}

return a[total-1];

}

public static void main(String args[]){

int a[]={1,2,5,6,3,2};

System.out.println("Largest: "+getLargest(a,6));

}}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!