ๆญฃๅœจๅŠ ่ฝฝๅ›พ็‰‡...
โ– T(n)=aT(n/b)+O(nd) rmไบŒz ifd logb a O(ndlogn) if d logb a if'd logb a. Merge sort:T(n)<2T(n/2)+0(n). a=b=2,d=1.So d=logb a. By the master theorem:T(n)=0(n logn). 10โ—ผ ๐‘‡(๐‘›) = ๐‘Ž๐‘‡(๐‘›/๐‘) + ๐‘‚(๐‘› ๐‘‘ ) โ—ผ Merge sort: ๐‘‡(๐‘›) โ‰ค 2๐‘‡(๐‘›/2) + ๐‘‚(๐‘›). โ—ผ ๐‘Ž = ๐‘ = 2, ๐‘‘ = 1. So ๐‘‘ = log๐‘ ๐‘Ž. โ—ผ By the master theorem: ๐‘‡(๐‘›) = ๐‘‚(๐‘› log ๐‘›). 10
<<ๅ‘ไธŠ็ฟป้กตๅ‘ไธ‹็ฟป้กต>>
©2008-็Žฐๅœจ cucdc.com ้ซ˜็ญ‰ๆ•™่‚ฒ่ต„่ฎฏ็ฝ‘ ็‰ˆๆƒๆ‰€ๆœ‰