Question: P2 (15pt): Most graphics hardware includes support for a low-level operation called blit, or block transfer, which quickly copies a rectangular chunk of a pixel

DDD AB CD 5 blits | DB recurse AB C D recurse 5 blito D Figure 1. Two algorithms to rotate pixel map. (a) Prove that both versions of the algorithm are correct when n is a power of 2. (b) Exactly how many blits does the algorithm perform when n is a power of 2? (c) Describe how to modify the algorithm so that it works for arbitrary n, not just powers of 2. How many blits does your modified algorithm perform? (d) What is your algorithm's running time if a kxk blit takes (ka) time? (e) What if a k x k blit takes only O(k) time? DDD AB CD 5 blits | DB recurse AB C D recurse 5 blito D Figure 1. Two algorithms to rotate pixel map. (a) Prove that both versions of the algorithm are correct when n is a power of 2. (b) Exactly how many blits does the algorithm perform when n is a power of 2? (c) Describe how to modify the algorithm so that it works for arbitrary n, not just powers of 2. How many blits does your modified algorithm perform? (d) What is your algorithm's running time if a kxk blit takes (ka) time? (e) What if a k x k blit takes only O(k) time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
