Respuesta :
Answer:
Following are the solution to this question:
Explanation:
Its complexity of both the pseudo-code described is indeed proportional to the number of digits. So, how often number there are in this specific number is the query. Whenever a number is considered, the d digit would be between [tex]10^{(d-1)}.[/tex] inclusive exclusive [tex]10^d[/tex] That would be as, let d become the number of digits at N, and the inequalities, They can tell
[tex]10^{(d-1)} \leq N < 10^d[/tex]
We get, we take a logarithm,
[tex]d-1 \leq \log(N) < d[/tex]
The increase of 1 to the left inequality, [tex]d \leq \log(N)+1[/tex], and Combining the previous outcome, we got, [tex]\log(N) < d \leq \log(N) + 1[/tex]. That's would be to say, that number of number d by [tex]O(\log(N))[/tex] is higher and lower. Consequently, the number of transactions in the code is [tex]O(\log(N))[/tex]
We have that the number of operations that are executed in the code in terms of n is mathematically given as
The quantity of operations done in the code is O(log(N))
Operation
Generally the equation for the is mathematically given as
If we think about a number,
with d digits is between 10^(d-1) inclusive and 10^d exclusive.
Let d be the wide variety of digits in N
10^(d-1) <= N < 10^d
d-1 <= log(N) < d
d <= log(N) + 1,
The Inequality
log(N) < d <= log(N) + 1.
Therefore
The quantity of operations done in the code is O(log(N))
For more information on Inequality visit
https://brainly.com/question/19491153