Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

P 1 . [ 3 pts ] Use the method illustrated in class ( recursion trees in the textbook ) to derive the solution to

P 1.[3 pts] Use the method illustrated in class (recursion trees in the textbook) to derive the solution to the following recurrence. Show your work. (Please draw the recursion tree)
T(n)=2T(n/4)+n2.
P 2.[4 pts] Describe a divide and conquer algorithm to compute the square of an n-digit integer in O(nlog23time, by reducing to the squaring of three n/2-digit integers. Adding two numbers with k digits, and shifting a number with k digits take O(k) time.
Your submission should include the following points:
Problem statement. You need not provide an example.
The main idea of the algorithm. Argue the correctness of your algorithm here,
by showing how the algebraic derivations are used by your algorithm.
Algorithm pseudo-code.
Running time analysis. You can directly use the solution of the recurrence
relation worked in class (aka Master Theorem / recursion trees section in the
text).(Please show all the steps for the 4 points)
Hint: use the identity xy =x2+y2-(x-y)22.
P 3.[3 pts] Describe a divide and conquer algorithm to compute the square of an n-digit integer in O(nlog36time, by reducing to the squaring of six n/3-digit integers.
Include the same points in your submission as for Problem P 2.. Is this algorithm
asymptotically faster that your algorithm from P 2.?
Hint: use the expression for (x+y+z)2.
(Please show all the 4 steps for this question from P2)
P 4.[3 pts](BONUS) Describe a divide and conquer algorithm to compute the square of an n-digit integer in O(nlog35time, by reducing to the squaring of five n/3-digit integers. To simplify the analysis, we assume that the numbers in the recursive calls do not require more bits than the terms that make up these numbers. This means thatthe number of digits of the integers passed to the recursive calls do not exceed n/3
Include the same points in your submission as for Problem P 2.. Is this algorithm
asymptotically faster that your algorithm from P 2.?
Hint: investigate the expression (x + y + z)2+(x y + z)2.
(Please show all the 4 steps for this question from P2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions