BA 6 Karatsuba's Algorithm, Closest Pair in the Plane

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

T/F Karatsuba's Algorithm isn't divide and conquer

F

Karatsuba's algorithm

T(n) = 4T(n/2)+Θ(n)

Closest pair of points brute force

check every 2 pair (n 2) = n(n-1)/2 = Θ(n^2)

How to improve efficiency for divide and conquer algorithm in T(n)=a(T/b) + f(n)

decrease a and f(n), increase b

Optimization in closest pair problem

divide into sub-grid of δ/2, sort by y and check only 11 above the cell

Closest pair of points DC

divide to 2, solve subproblem for each half, combine by finding the closest across the boarder, output the min of the 3!

two n-bits integers, compute a x b

naive: Θ(2^n * n) - b * (n per addition) - b = O(2^n) elem algo: Θ(n^2)

For optimization in closest pair problem, we use what strategy to improve algorithm efficiency

reduce f(n), because we reduce the sorting in combine part of the DC problem from nlog^2n to nlogn

Improve Karatsuba's algorithm

reeduce a, achieve n^1.585

run time for cross-border closest pair optimization

sort once at the very beginning, then Θ(nlogn)! - Θ(nlogn) for sort y, Θ(nlog^2n) if not sort in the beginning;


संबंधित स्टडी सेट्स

S1, S2, . . . , Sn forms a partition of S if Si and Sj are

View Set

Life Insurance - Chapter 3 - Policy Provisions, Riders and Options

View Set

Chapter 10: Antepartum Fetal Assessment

View Set

glomerular filtration rate and renal blood flow

View Set

Climate Change Economics Berkeley C176

View Set

International Business Law Test #2

View Set