Alg 2 Has i = i + 1. Paired with i++, that raises the value of i by 2s instead of 1s. Checks involve when i= 1, 2, 4, and 6. Isn't that n + 2 - 2 = n since 6 gets checked, but 3 and 5 do not? Additionally, the loop gets accessed only 3 times when i = 1, 3, 5. Would that not make print(i) be n-1 and i = i+1 also be n - 1. If all of that is correct, would not T(n) = n + (n - 1) + ( n - 1) + (n - 1) = n + n + n + n - 1 - 1- 1 = 4n - 3?
In the last example how you decided that the dominating term is n^2? The n^2 term comes thrice in the equation while the term 'n' comes four times. So the dominating term is 'n' ? I am confused... How to decide the dominating term? Is it the highest power term?
thanks sir for making us clear about generic RAM and hoping for more lectures in the future
Alg 2
Has i = i + 1. Paired with i++, that raises the value of i by 2s instead of 1s.
Checks involve when i= 1, 2, 4, and 6. Isn't that n + 2 - 2 = n since 6 gets checked, but 3 and 5 do not?
Additionally, the loop gets accessed only 3 times when i = 1, 3, 5. Would that not make print(i) be n-1 and i = i+1 also be n - 1.
If all of that is correct, would not T(n) = n + (n - 1) + ( n - 1) + (n - 1) = n + n + n + n - 1 - 1- 1 = 4n - 3?
Pretty clear explanation...Thank You.
In the last example how you decided that the dominating term is n^2? The n^2 term comes thrice in the equation while the term 'n' comes four times. So the dominating term is 'n' ? I am confused... How to decide the dominating term? Is it the highest power term?
yes, According to the complexity chart., n^2 is greater than n
sir, please use mic however lectures were so informative and clear I feel more confident
Thanks you sir for your great explanation.
at 8:56 wont the loop check for n+1 time?
I think that in the minute 19:19 C4 should be (n+1) for the second while INTO (n+1) from the first while.
and so on for C5 and C6. If Im Right
yes i think the same
thank you sir😊 for making this clear
Hello Sir,
How will be the time complexity for
for(i=2; i+i
0(n)
Sir, please spare a time to make video of randomized and heap sort. My health was undergoing to the treatment process at your lecture time.
Merci Kandel
Thanks sir. Hello everyone, let us at least like and subscribe to the channel. This is a very good information.
Explanation follows KISS principal..superb man
Great 👍👍👍👍
Thank you very much. (y)
Thanks!
awesome
Veeeeery nice
@hridaya sir aru ni video banaunu prney ni sir
BscCsit✌
nepali mai padayeni huncha hola :D just a thought :D
plzz thora uncha bolo