• retagged by
245 views
1 1 vote

Let $f(n)$ and $g(n)$ be two functions. Recall that $f(n)=O(g(n))$ if there exist positive constants $c$ and $n_{0}$ such that for all $n \geq n_{0}$,
$$
f(n) \leq c \cdot g(n)
$$
Which of the following statements is correct?

  1. $c$ and $n_{0}$ must be integers
     
  2. $g(n)$ cannot be $O(1)$
     
  3. If $f(n)=g(n)$, then $f(n)=O(g(n))$
     
  4. $c$ cannot be greater than $n_{0}$

1 Answer

0 0 votes

Direct defination 

  • A is false because $c$ is defined as a positive real constant ($c > 0$). It can be a fraction (e.g., $c=0.1$).

  • B is false because $g(n)$ can be any function, including constants ($1, 2, 10$).

  • D is false because $c$ and $n_0$ are independent parameters; one does not limit the value of the other.

  • C is true by definition: if $f(n) = g(n)$, then $f(n) \leq 1 \cdot g(n)$ for all $n \geq 1$.

Option C is  correct. 

Answer:
Position:
Show:

Related questions

1 1 vote
0 0 answers
227
227 views
GO Classes asked Mar 17
227 views
A new sorting algorithm is proposed to arrange an array in descending order. The algorithm scans the elements of the array sequentially. If an element is found to be out ...
0 0 votes
0 0 answers
215
215 views
GO Classes asked Mar 17
215 views
An array of size $n$ is given in sorted order. We want to find the ceiling of a given value $x$ in the array.The ceiling of $x$ is defined as the smallest element in the ...
0 0 votes
2 2 answers
302
302 views
GO Classes asked Mar 17
302 views
Consider the directed weighted graph shown in the figure. Assume that Dijkstra's shortest path algorithm is executed with node $A$ as the source. For which of the nodes d...
0 0 votes
0 0 answers
194
194 views
GO Classes asked Mar 17
194 views
Consider the graph shown in the figure.Breadth-First Search (BFS) traversal is performed starting from node $D$. Which of the following sequences could be a valid BFS tra...