Похожие чаты

Sir, it's kind of confusing. Help me! n/2 is basically 1/2(n).

If you drop constant, then it becomes (n).
but conceptually, it's half the loop.

in short, this is Complexity question.

is n/2 = n??????

5 ответов

11 просмотров

O(n/2) is same as O(n) Because what being measured is how fast the execution time/memory/etc. grows with increasing n. https://en.m.wikipedia.org/wiki/Big_O_notation

Deleted Account- Автор вопроса
Pavel
O(n/2) is same as O(n) Because what being measured...

True sir, I am looking into the definition for asymptotic notation. And my doubt is Does Big Oh care about any constants ? Ref: https://xlinux.nist.gov/dads/HTML/bigOnotation.html excerpt from above: "Definition: A theoretical measure of the execution of an algorithm, usually the time or memory needed, given the problem size n, which is usually the number of items. Informally, saying some equation f(n) = O(g(n)) means it is less than some constant multiple of g(n). The notation is read, "f of n is big oh of g of n". But I am confused here Formal Definition: f(n) = O(g(n)) means there are positive constants c and k, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ k. The values of c and k must be fixed for the function f and must not depend on n." I got my crack but still confused with this formal definition.

Deleted Account
True sir, I am looking into the definition for asy...

That is just how you would rigorously define it O(n^3 + 3n^2 + 1) becomes O(n^3) as 0 < (n^3 + 3n^2 + 1) < 3(n^3) for all n > 2, here c = 3, k = 2 O(n/2) becomes O(n) as 0 < (n/2) < 3n for all n > 0, here c = 3, k = 0

Deleted Account
True sir, I am looking into the definition for asy...

to calculate bigO just think of what class of function the complexity falls under.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта