subject

;to bubble sort, you need to scan the array n-1 times, ; in every scan, you compare from top down each two consecutive elements, and you swap them if they are not in ascending order. ; notice that in the first scan you get the largest element (no matter where it is in the array) pushed all the way to the bottom. ; so your next scan should be n-1 iterations, and then n-2 and so on. ; so every time you come back to the top of the array for a new scan, your n (the number of comparisons) must be decremented by 1. ; in the last scan, you need only one comparison. ; hints: ; your sorting algorithm starts with r6 as a pointer to the array ; you need to save n (number of elements) in r8, then decrement it by 1 (n-1) to become the number of comparisons. ; copy r6 to r7 so you keep r6 unchanged as it points to the top of the array for every new scan. ; copy n-1 to r9 and use r9 as a loop counter, while keeping the current n-1 value in r8 for the next scan. ; in the scan loop get an element and auto increment pointer r7, then get next element without changing r7. ; compare the two elements, if not in ascending order, swap them. ; repeat the scan from the top as pointed to by (r6), and every time decrement the number of comparisons (r8).

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
The animal classthis class represents a an animal residing at a zoo. it has a weight (in pounds),height (in inches), a name, and a color. the methods in the class include constructors,getters, and a tostring. you will finish the implementation of these methods. referto the code documentation.1.getters: you will need to implement getter methods. these get a value (froma member variable) in the animal class. you will make a getter method toreturn each variable (weight, height, name, color). reference getname if youare having issues.2.tostring: you will need to finish the tostring method. this returns a stringcontaining information about an animal. the output string should be of theformat: ” (name) , a ( color )â’colored animal . ( weight ) pounds , ( height ) inches .\n”the height and weight are formatted to 1 decimal place. recall from lab 1how to format strings neatly using string. see the reference sectionfor more about string.format.
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
All of the following are characteristics that must be contained in any knowledge representation scheme except
Answers: 3
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
Read the following scenario, and then answer the question below. you want to send an e-mail to your boss requesting a meeting to discuss a raise. what is the best example of an e-mail to an employer about this meeting? “hey jason. can we chat about getting me more money soon? let me know. peace, meg.” “hello jason. pardon me for sending yet another e-mail today about my need to talk to you about my position and a possible pay increase. i am dying to know when you can talk. sincerely, meg.” “hello jason. i have been with the company for one year and have taken on more responsibilities than outlined in my job description. i would appreciate an opportunity to speak with you about my position. let me know when we can schedule a meeting. you, meg.” “greetings jason! i hope this e-mail finds you well and happy today. i really, really want to talk to you about something important. i am not sure if you have time. i hope you do. get back in touch with me and let me know when we might talk. ever so much for taking the time to read this. sincerely, meg.”
Answers: 3
You know the right answer?
;to bubble sort, you need to scan the array n-1 times, ; in every scan, you compare from top down ea...
Questions
Questions on the website: 13722359