Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed

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

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

1. Differentiate between high and low culture.

Answered: 1 week ago