假设在最坏的情况下,对于大小为64的输入,mergesort算法需要30秒。以下哪项最接近于6分钟内可以解决的问题的最大输入大小? (A) 256 (B) 512 (C) 1024 (D) 2048 答复: (B) 说明:
null
Time complexity of merge sort is Θ(nLogn) c*64Log64 is 30 c*64*6 is 30 c is 5/64 For time 6 minutes 5/64*nLogn = 6*60 nLogn = 72*64 = 512 * 9 n = 512.
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END