algorithm - (merge sort) is log from n log n on base 2? -


i've learned in class merge sort o(n · log(n)), i'm not clear on whether it's o(n · log2(n)) or o(n · log10(n)). i've read on stack overflow (at big o notation log base 2 or log base 10) "it not matter" because give approximately same runtime; want exact runtime. example, know bubble sort 512 elements takes 512²/2 − 512/2 = 130816 time units; merge sort 512 elements take 512 · 9 = 4608 time units, or 512 · 5.404 = 2767 time units?

since merge sort divides arrays halves, yup, base 2. comments say, base constant factor it's not important in big o notation.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -