3. Time Complexity Of Nested Loops

preview_player
Показать описание
This Video tells about how to Calculate Time Complexity for a given Algorithm which includes Nested Loops
An important note to the viewer:
1. In all the videos every point is repeated more than twice
2. Reason behind that is to write the notes clearly so that you can revise in future
3. When problem comes please pause the video and try to solve
4. If you aware of the concept please see video with 1.5X speed
Рекомендации по теме
Комментарии
Автор

thank you so much, i finally understand... i was confused how it become n square but thanks to your explanation

aoyukialquen
Автор

sir please make more videos on nested loop time complexity

MdSajjad-jrsq
Автор

Hello Sir,
What's the time complexity of:
for (int i=0; i<n; i++)
for (int j=0; j<n; j+=i)

__nitinkumar__
Автор

Sir can you please explain time complexity of next greater element using stack

sriyabonda
Автор

Thank you so much!! that was so helpful

solenesossah
Автор

Thank you for this wonderful explanation♥♥♥♥

-omarabusnineh
Автор

While (I<n)
{
While (I<n && a[I]==a[i-1])
{
I++;
}
I++;
}
What will be time complexity of this loop?

nehaprasad
Автор

Great explanation sir! but how did you derive the sum of fraction series into log base 2 n for the 2nd last q?

devilboii
Автор

for question at 4 minute you are multiplying n*n but for question at 6 min you just taking inner loop complexity, why it is not O(n^3) ? pls tell

Gaurav-zhpm
Автор

sir you have written time complexity log n base 2 in the last 2nd question so why did you write base 2 only, it is not base 2, it will be base n hai because the value of i is 1, 2, 3, 4, .... going up to n so why did you write base 2 only

jar
Автор

for (i=0 ; i<n ; i++)
{
for (j=0; j<i*3 ; j++)
{
for (k=1; k<20; k=k*4)
{
Statement
}
}
}
then ....time complexity ???

Tan-stsp
Автор

Pls help me sir for below question
Compute the complexity analysis and asymptotic complexity of following code.
int x=0;
for (int i=1; i<n;i=i+2)
for (int k=n;k>=n;k=k--)
x++;

mohammedkemal
Автор

If we have third inner for loop
for(k=1;k<=J; k++)
Then time complexity?

kavita
Автор

Second last answer is incorrect. Series is harmonic!!

mabdurrafeyahmed