Question: .data original_list: .space 100 sorted_list: .space 100 str0: .asciiz Enter size of list (between 1 and 25): str1: .asciiz Enter one list element:
Project Details All the source code is contained in based on user inputs. Then it performs Insertion Sort on the list. Finally it searches for a user defined key using Binary Search. Your task is to implement 3 of the functions described below. Make sure you DO NOT modify the main method In order to understand how arguments are passed to the following functions, study the main function CAREFULLY This program creates a list of integers printList: It is a function to print out the content of a list. It takes in a list and its size as arguments. It does not return any value. . inSort: It performs Insertion Sort in ascending order on a list. It takes in a list and its size as arguments. It returns the sorted list as a new list. You may use sorted list defined in the data segment in this function. . bSearch: It performs a recursive Binary Search of a key on a list. It takes in a list, its size, and a search key as arguments. It returns 1 if the key exists in the list, otherwise it returns 0. You must implement this algorithm recursively therefore, be aware of the use of stack memory . Creat e as man y test cases as possible so that your program is free of error Sample output from BinarySearch.s: Test case #1 Enter size of list (between 1 and 25): 5 Enter one list element: Enter one list element: Enter one list element: Enter one list element: Enter one list element: Content of list: 5 4738 Content of list: 3 4578 Enter a key to search for: 5 Key found program is finished running Test case #2: Enter size of list (between 1 and 25): 8 Enter one list element Test case #3: Enter size of list (between 1 and 25):5 Enter one list element Enter one list element: Enter one list element Enter one list element: Enter one list element: Enter one list element: Enter one list element Enter one list element Enter one list element Enter one list element 1-2 of 2 list: 73552
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
