Home / Expert Answers / Computer Science / hello-nbsp-can-anyone-answer-give-explanation-nbsp-to-these-two-problems-nbsp-i-will-give-thumbs-pa880

(Solved): HELLO  can anyone answer/give explanation  to these two problems. I will give thumbs ...



HELLO  can anyone answer/give explanation  to these two problems. I will give thumbs up when answered, thank you.

  1. Take a look at the list of numbers below. You have the method available:
    swap(a,b) where a and b are the LOCATIONS of the numbers in the line. Sort the list of numbers in as few uses of ‘swap’ as possible.
    (3,5,1,2,4,10,7)

     
  2. Look at the two rectangles in this grid. You have two methods: 
    translate(a,b): Move the rectangle to the right for a positive value of a, and move up for a positive value of b.
    resize(c): Multiply the size of the rectangle (if you choose 2, both the length and the height are doubled). In all cases, the top left corner stays static as the rectangle resizes.
    What methods would you call on the second rectangle so it becomes superimposed (perfectly overlaps) the first rectangle?

\( \square_{0} \)

 

\( \square_{0} \)


We have an Answer from Expert

View Expert Answer

Expert Answer


1: Take a look at the list of numbers below. You have the method available: swap(a,b) where a and b are the LOCATIONS of the numbers in the line. Sort the list of numbers in as few uses of ‘swap’ as possible. (3,5,1,2,4,10,7) Answer: 4 Explanation: A
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe