• edited by
595 views
3 3 votes

$f(n)=2n^2+ n log n$

$g(n)= \dfrac{n}{logn} + log^2n$ then 

$f(n)\times g(n)$ is:

  1. $n^2logn$
  2. $\dfrac{n^3}{logn}$
  3. $n^3log^2n$
  4. $n^2log^2n$

1 Answer

1 1 vote
$f(n) = 2n^2 + nlogn$

$2n^2 > nlogn$

$f(n)\approx 2n^2$

 

$g(n) = n/logn + log^2n$

$n/logn > log^2n$

put $n = 2^{16}$

$n/logn = 2^{16} / log 2^{16} = 2^{16} / 2^4 = 2^{12}$

$log^2n = log^2 \ 2^{16} = loglog2^{16} = 4$

$g(n)\approx n/logn$

 

$f(n)*g(n) \approx 2n^3/logn$

$n^3/logn$
Position:
Show:

Related questions

2 2 votes
1 1 answer
165
165 views
GO Classes asked Aug 31
165 views
The algorithm $\text{ALGSORT}$ sorts an array of distinct integers using comparisons.The function $\text{MININDEX(V,i,j)}$ returns the position of the smallest element in...
1 1 vote
1 1 answer
112
112 views
GO Classes asked Aug 29
112 views
Suppose Huffman coding is implemented as follows.Initially, the $n$ symbols are stored in a min priority queue according to their frequencies.The algorithm repeatedly per...
0 0 votes
1 1 answer
92
92 views
GO Classes asked Aug 26
92 views
Consider,f1(N): x = 0 for i = 0 to N - 1: x++ return xand,f2(N, R): x = 0 for i = 0 to N - 1: for j = 1; j <= R; j = j + j: x = x + f1(j) return xWhat is the order of gro...
2 2 votes
1 1 answer
381
381 views
KrishnaVardhan asked Oct 7, 2024
381 views
Even though there are two for loops some times the Time complexity will be the m+n and some times it will be m*n assuming loops run till m and n respectively.How do we di...