|
ºÐÇÒ°ú Á¤º¹ »ç·Ê
|
|
¡á Å« Á¤¼öÀÇ °ö¼À
NÀÚ¸® 2°³ÀÇ ¾çÀÇ Á¤¼ö X,
YÀÇ °ö¼À ¼öÇà½Ã°£Àº ¥è(N2)ÀÌ´Ù.
X = 61,438,521 ÀÌ°í, Y
= 94,736,407 À̸é XY = 5,820,464,730,934,047
X, Y¸¦ 2µîºÐÇÏ¿© XL
= 6,143 XR = 8,521 YL
= 9,473 YR = 6,407À̶ó¸é
X = XL104
+ XR À̸ç, Y = YL104
+ YR ÀÌ´Ù. Áï, ´ÙÀ½ ½ÄÀÌ ¼º¸³ÇÑ´Ù.
XY = XLYL108
+ (XLYR + XRYL)104
+ XRYR ----------------------
(1)
½Ä (1)ÀÇ ¼öÇà½Ã°£ : 4¹øÀÇ
N/2ÀÚ¸® °ö¼À°ú O(N)¹øÀÇ µ¡¼À, Áï
T(N) = 4T(N/2) + O(N)
¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª> O(N2) ----------------------
(2)
½Ä (2)¿¡¼
N/2ÀÚ¸® °ö¼À 4¹øÀ» N/2ÀÚ¸® °ö¼À 3¹øÀ¸·Î ´ëü°¡´É
XLYR
+ XRYL
= (
XL - XR )( YR - YL
)
+ XLYL +
XRYR ---------------
(3)
½Ä (3)¿¡¼
XLYL °ú
XRYR
Àº ½Ä (1)¿¡¼ ÀÌ¹Ì °è»êÇÑ °ÍÀÌ´Ù.
µû¶ó¼
( XL - XR )( YR - YL
) ÀÇ N/2ÀÚ¸® °ö¼À
ÇÑ ¹ø¸¸ Ãß°¡ÇÏ¸é µÈ´Ù.
Áï,
T(N) = 3T(N/2) + O(N) ¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª>
O(Nlog3) = O(N1.59) --------------
(4)
|