0 votes 0 votes State true/false f(n) != O(g(n)) and g(n) != O(f(n)) Algorithms algorithms time-complexity asymptotic-notation + – sushmita asked Sep 28, 2018 sushmita 356 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Shaik Masthan commented Sep 28, 2018 reply Follow Share true... classic example is, f(n)=n and g(n) = n(1 + sin x ). if sin x ===> min.value = -1 ===> g(n) = O(f(n)) if sin x ===> max.value = +1 ===> f(n) = O(g(n)) Finally you can't say, it is g(n) = O(f(n)) or f(n) = O(g(n)) 3 votes 3 votes sushmita commented Sep 28, 2018 reply Follow Share can we take a variable x in our function? one more example- is it correct? f(n)=1 g(n)=n*sin(n) g(n) will oscillate between -n and n and hence sometimes greater than 1 and sometime less than 1. 1 votes 1 votes Shaik Masthan commented Sep 28, 2018 reply Follow Share you may take it. 0 votes 0 votes Gurdeep Saini commented Dec 26, 2018 reply Follow Share if the question will be like this is it possible f(n) != O(g(n)) and g(n) != O(f(n)) ? then it will be true @Shaik Masthan if the statement is not true for all case then we choose false 1 votes 1 votes Shaik Masthan commented Dec 27, 2018 reply Follow Share i consider the statement as is it possible f(n) != O(g(n)) and g(n) != O(f(n)) ? that why i commented as true. But yes, what you said is absolutely correct :) 1 votes 1 votes Please log in or register to add a comment.