Question
Convert this C Code: # void sort(char **list, int n){ # int sorted=0, i=1, j; # char *temp; # while(i < n && !sorted){ #
Convert this C Code:
# void sort(char **list, int n){ # int sorted=0, i=1, j; # char *temp; # while(i < n && !sorted){ # j=0; # sorted = 1; # while(j
To assembly sort function starting with ".globl sort" that receives a pointer to an array of strings and the number of elements in the array. The function uses bubble sort to sort the array. test cases include "./prog2 sort bla blo obl abl lab bol bal lob" giving "sorted list = {abl, bal, bla, blo, bol, lab, lob, obl}"; "./prog2 sort 300 500 200 600 400 100 800 700" outputting "sorted list = {100, 200, 300, 400, 500, 600, 700, 800}", and "./prog2 sort kiwi strawberry apple orange banana peach blueberry mango" outputting "sorted list = {apple, banana, blueberry, kiwi, mango, orange, peach, strawberry}"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started