Hi there,

I am having trouble understand how they derive these running times for the code in the image below.

http://i.imgur.com/usK9U.jpg

I am having trouble especally with log n running times, how are they derived? especially the bottom left slide.

If someone can shed some light on this, I would gladly appreciate it!!!

Thanks in advance.

The log is caused by the j <= n/i
As i gets larger n/i will get smaller
Try replacing n with and actual number and see the results

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.