Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
本 CLRS の 69 ページで、nC2 は単位分割統治法 (U - 4) の Θ(n^2) であると述べられています。この結果がどのように真実であるかを説明できる人はいますか?
nC2 = n*(n-1)/2 = (n^2-n)/2;
ヒント:
(n^2-n)/2c1*(n^2)のような定数c1 < 1/4や の値よりも大きくなりますn = 2。同様に、およびc2*n^2の値よりも小さくなります。これがサンドイッチのような状況です。同様に、n と定数 c の他の値についても挟まれます。したがって、.c2 = 1n = 2nC2 is Θ(n^2)
(n^2-n)/2
c1*(n^2)
c1 < 1/4
n = 2
c2*n^2
c2 = 1
nC2 is Θ(n^2)