Question: Write in MIPS Assembly Write an assembly program to sort an array using the following methodology: Given two arrays A and B such that: The

Write in MIPS Assembly Write in MIPS Assembly Write an assembly program to sort an array

Write an assembly program to sort an array using the following methodology: Given two arrays A and B such that: The elements of B are distinct (no duplicates). All elements in B are in A. Sort the elements of A such that: The relative ordering of items in A are the same as in B. Elements that don't appear in B should be placed at the end of A in descending order. . Sample test case 1: Input: arr1 = [2,3,1,3,2,4,6,7,9,8,2,19,1,6] arr2 = [2,1,4,3,9,6,7] Output: [2,2,2,1,1,4,3,3,9,6,6,7,19,8] Sample test case 2: Input: arr1 = [2,3,1,3,2,4,6,7,9,8,2,19,1,6,20] arr2 = [2,1,4,3,9,6,7,8] Output: [2,2,2,1,1,4,3,3,9,6,6,7,8,20,19] Write an assembly program to sort an array using the following methodology: Given two arrays A and B such that: The elements of B are distinct (no duplicates). All elements in B are in A. Sort the elements of A such that: The relative ordering of items in A are the same as in B. Elements that don't appear in B should be placed at the end of A in descending order. . Sample test case 1: Input: arr1 = [2,3,1,3,2,4,6,7,9,8,2,19,1,6] arr2 = [2,1,4,3,9,6,7] Output: [2,2,2,1,1,4,3,3,9,6,6,7,19,8] Sample test case 2: Input: arr1 = [2,3,1,3,2,4,6,7,9,8,2,19,1,6,20] arr2 = [2,1,4,3,9,6,7,8] Output: [2,2,2,1,1,4,3,3,9,6,6,7,8,20,19]

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!