SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,julia Lobur
Chapter:
Standard Template Library
Exercise:
Self-test Exercises
Question:18 | ISBN:9780321531346 | Edition: 7

Question

Show that for any two bases a and b for logarithms, if a and b are both

greater than 1, then there is a constant c such that loga N c(logb N).

Thus, there is no need to specify a base in O(log N). That is, O(loga N)

and O(logb N) mean the same thing.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

This is mathematics, not C++. So, = will mean equals not assignment.

First note that loga N = (loga b)(logb N).


To see this first identity just note that if you raise a to the power loga N

you get N and if you raise a to the power (loga b)(logb N) you also get N.

If you set c = (log a b) you get log a N = c(log b N).

0 0

Discussions

Post the discussion to improve the above solution.