For the remaining three problems in this Exercise, we assume that the sort function from Figure 2.27

Question:

For the remaining three problems in this Exercise, we assume that the sort function from Figure 2.27 is changed in the following way:a. b. void swap(int *p. int *q){ int temp: temp=*p: *p=*q: *q-temp: void swap(int *p. int *q){ *p=*p+*q:

Figure 2.27

Move parameters Outer loop Inner loop Pass parameters and call Inner loop Outer loop sort: forltst: for2tst:exit1: 1w 1w 1w 1W 1w addi jr Restoring registers $50, 0($sp) $s1, 4($sp) # restore $s1 from stack $s2,

When sorting a 10-element array that was sorted in descending order (opposite of the order that sort() creates), how many more (or fewer) instructions are executed as a result of this change?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Computer Organization And Design The Hardware Software Interface

ISBN: 9780123747501

4th Revised Edition

Authors: David A. Patterson, John L. Hennessy

Question Posted: