t = C * n log n, where C is the constant of proportionality, which
will depend on the base of the logarithms used. (We can use any
convenient base. I'll use base 10.)
1 = C * 1000 log 1000
so C = 1/3000.
Then, when n = 10,000, t = 10000 * log 10000 / 3000 = 40000/3000 =
13.3 sec.
The algorithm will take about 13.3 seconds.

Dave

On Jul 28, 7:07 am, sourav <souravs...@gmail.com> wrote:
> A sorting algorithm takes 1 second to sort 1,000 items on your local
> machine. How long will it take to sort 10,000 items ...
>
> if you believe that the algorithm takes time roughly proportional to
> nlogn?
> [Show your calculations / logic to arive at an answer]

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to