A) Drop lower order terms B) Drop the multiplier C) Total running time is sum of fragments. For large input sizes the the run time depends upon the fragment with highest run time D) If there are two cases possible the time complexity depends upon the worst case scenario (the one with largest time complexity)
I am in grad school for software engineering and love to program. I've seen a lot of channels, many good ones, but yours is one of the absolute best. I come back to your videos to refresh and learn, pick up stuff that went over my head the first time around.
You should explain the Theta and the Omega general rules as well, it would be awesome, finally I understand how to calculate Time Complexity with your videos. :D
Your explanations are some of the best CS videos I have found anywhere, including videos from universities! Your channel has a lot of videos, some idea of which playlists and videos to start with and what to watch next would be great. Great job!
Thank you for making this video! I am currently taking an algorithms class and this part of the class is giving me the most trouble in understanding the time complexity of the code. Your guidance of this topic makes things so much simpler to understand.
Thank you for the extremely precise and accurate video. 45 lecture videos and this still somehow manages to explain it better, more efficiently and in simpler terms
this is so helpful, the whole big o thing clicked to me by watching this video. Was still a little confused watching the first few videos in areas but this video made 100% sense to me. especially when you demonstrated just to focus on the areas that have the biggest impact to overall time and the outer and inner loop example was great for me, saying n loop x n loop = n^2 clicked inside my head. thanks again, best big o vid on youtube and ive watched heaps of them. please make some more vids on some recursive examples if you could
Thank you for these videos! The book I was studying started talking about O() time, which I generally understood, but then it started in on T() time and using them in equations together also and I couldn't work out what made the two different and how they fit together. These videos gave me a clear perspective with which to finish my chapter.
So appropriate!!! It is so hard to find a correct explanation. There is no certainty of material available on the internet. This series seems correct so far! VVVVVEEErrrryyyy Good!!!!
Finally! A video where I got the understanding of time complexity. Thankyou so much for this incredible explanation! Subscribed to your channel after watching this 1st video itself! Thankyou!!
Excellent work! Already proposed it to all my classmates in one of the best universities of Paris! Please add the O(logn) and O(2^n) cases when possible. Thanks a lot.
really sir all these classes were crystal clear 2 me, although i have joined a separate course for this i barely understood this topic, thank u very much ..but what about the further topics ..... please post them ASAP... looking forward to them
Are you a university professor? If not, you should seriously consider it. You've managed to teach how to calculate time complexity better than any of my professors.
well he's harsha s. a top coder in the country of the time. yes the country. we'll always remember him. RIP Harsha Suryanarayana. you may have gone but your work will live on. long live humblefool
At 4:38, O(n+1) might come as loop would even check/compare i=n and then return false.... but it would use time in comparing! If n tends to infinity than we can neglect constant and keep it as O(n)
hi, at the end of this video you mentioned about the next video in the series "calculating time complexity of recursive programs". I cant find it. If you have uploaded more videos in the series please provide links to the complete series.
Hi, Thank you for such informative video. But can you give examples of codes that would at O(lg N), loops would be a certain indication of O(N), or O(N^2) but how about the others? For example, what is the running time of the prime function on your first video? and why? thanks.
Hello, in the tutorial we see O(n), O(n^2),O(n^3) time complexities. But when would you associate logarithmic functions to time complexities. When and how would u calculate that time complexity of a particular code is O(logn) or O(nlogn) ?
Hi Sir. First Thanks for making things crystal clear. I have a question, at last, we discussed the if and else and we took the worst case which is true for O. Instead of going to big O can we have solved that using theta that gives the tight bound ??
Hello sir.. u did lots of efforts to make us understand the above Complexity topic, but to make a perfectionist over this topic would you please upload some more videos over this topic by which we will get over all concept of complexity like log(n),log k(n),log b(n) etc related to this ..thank you so much anyways :-)
the outer loop runs n times. each time we run the outer loop, we run the inner loop since j is always set to 0 and it increments by 1 until it reaches logn (so it runs logn times) so we do the whole thing is (times you run outer loop) * (times you run inner loop) = n * logn
You need to see, how many times the inner loop will run. it will be n-1 times for i =0 , n-2 times for i=1 and so on. So, total will be (n-1) +(n-2) + (n-3) + ... + 1= n*(n-1)/2 which will be a polynomial expression of form an^2 + bn + c for some constants a,b and c. For such time expression highest order matters. So O(n^2)
But As you said that big-oh represents the set,then how can they be added?there should be a union between them.And then in set terms,there is nothing like lower order terms,so they can't be ignored.
gr8 tutorial guys, can you redirect me to any other of your videos where the running time of actual program is calculated, It will be great if there are examples and questions , thankx
6 years later and this is still the most clear and concise explanation I've seen
9*
10*
11
11 years later
A) Drop lower order terms
B) Drop the multiplier
C) Total running time is sum of fragments. For large input sizes the the run time depends upon the fragment with highest run time
D) If there are two cases possible the time complexity depends upon the worst case scenario (the one with largest time complexity)
In a nutshell.
I am in grad school for software engineering and love to program. I've seen a lot of channels, many good ones, but yours is one of the absolute best. I come back to your videos to refresh and learn, pick up stuff that went over my head the first time around.
The only and only explanation that helped me understand this analysis. Really thankful for the effort you put into making these videos.
This tutorial video was so well explained. Suddenly entire concept is looking so simple!
You should explain the Theta and the Omega general rules as well, it would be awesome, finally I understand how to calculate Time Complexity with your videos. :D
seeing comments from 4, 5, 6 , 7 years ago is so eerie it gives me chills...
Your explanations are some of the best CS videos I have found anywhere, including videos from universities! Your channel has a lot of videos, some idea of which playlists and videos to start with and what to watch next would be great. Great job!
Most Clear and Concise Explanation.
This channel is PURE GOLD!!
Thank you so much!!! I barely understood the topic and your video made it all clear for me! If I could, I would have given you a thousand likes! :)
Thanks Uri Yakir
1 dislike lets find that bastard :(
+BomBamBum for the first question, the runtime should be log n. for the second question, the runtime should be n log n
+Pond. Filler- may I ask how did you get log(n) for the first question?
so what's up with life now champ, what did you do ?
The best video on the entire web about Time Complexity.
Please do the complete series on design and analysis of algorithms. You are the best teacher I have ever encountered on RUclips.
He's no more
@@aayush5474 stupid, this guy is very much alive, and working at Google US. The other co-founder of the channel passed away in a car accident.
you are my savior!!! I couldn't have passed any of my classes without you.
please tell me you continued this series somewhere ???
hes no more
Thank you for making this video! I am currently taking an algorithms class and this part of the class is giving me the most trouble in understanding the time complexity of the code. Your guidance of this topic makes things so much simpler to understand.
Thank you for your clear explanations. Good teachers and tutorials are rare enough.
The only video you needed for this series
Thank you for the extremely precise and accurate video. 45 lecture videos and this still somehow manages to explain it better, more efficiently and in simpler terms
there are only 4 videos right??
@@hemantborse8923 yes I was implying that my lessons tried to cover something similar in over 45 lecture hours where they still didn't succeed
@@reys8022 ur damn right but that profile pic is still stuck at 2018 or 19 don't you think so?
Bhai!!!! Yaar really good explanation for the first time i get clear about time complexity. Such a simple and good explanation!!
i wanna give u big thanks since, u present the time complexity in a easiest way ever seen. keep it up
this is so helpful, the whole big o thing clicked to me by watching this video. Was still a little confused watching the first few videos in areas but this video made 100% sense to me.
especially when you demonstrated just to focus on the areas that have the biggest impact to overall time and the outer and inner loop example was great for me, saying n loop x n loop = n^2 clicked inside my head.
thanks again, best big o vid on youtube and ive watched heaps of them.
please make some more vids on some recursive examples if you could
Thanks a lot Stavros. We will try to get more in this series.
Thank you for these videos! The book I was studying started talking about O() time, which I generally understood, but then it started in on T() time and using them in equations together also and I couldn't work out what made the two different and how they fit together. These videos gave me a clear perspective with which to finish my chapter.
Take a bow. Amazing explanation. I find myself lucky that I have found this video in my search results.
Sure ! stay tuned :)
Sure Tudor, we will try to get more. :)
Best explanation of time complexity analysis. Thanks a lot for the video.
Great explaination after 9 years it is also clear to understood
So appropriate!!!
It is so hard to find a correct explanation. There is no certainty of material available on the internet.
This series seems correct so far!
VVVVVEEErrrryyyy Good!!!!
you dont know but actually you are doing a great service to the student community...lucky to come across your videos...
This was exactly what I needed to hear. This should be taught prior to backward substitution.
A great series of videos... short yet so descriptive. waiting for the upcoming ones!
this is gold
Thansk Wayne :)
+BomBamBum O(n^2) the both
+mycodeschool this is god
Old is gold
and still gold
Finally! A video where I got the understanding of time complexity. Thankyou so much for this incredible explanation! Subscribed to your channel after watching this 1st video itself! Thankyou!!
my god why did i find this guy so late. this man is amazing
Way of teaching is excellent.
Excellent lecture on time complexity, thanks for posting!
You are the best ! I was confused and lost even after reading lots of explanations.
Wow your explanation is very clear. our lecture spend hours to explain this
Your explanation clear my all doubts, so thank you so much
I know this is old but you’re the best!
We need a continuation of the series, please
best video ever on time complexity
Prof needed 1+ hour to explain this :)
thanks for your videos!!
sir you are my god..awesome teaching..plzz do more on algorithms plzz sir so that we can get help in our gate
Best explained. Understand in one shot.
Wow what a great start on algorithams :) , you have explained very well and made a great foundations. Thank you so much!!!!
Excellent work! Already proposed it to all my classmates in one of the best universities of Paris! Please add the O(logn) and O(2^n) cases when possible.
Thanks a lot.
It is a really good teaching video, well explained, thanks you so much!
Thanks for the detailed and clean explanations.
really sir all these classes were crystal clear 2 me, although i have joined a separate course for this i barely understood this topic, thank u very much ..but what about the further topics ..... please post them ASAP... looking forward to them
Sad to hear about your friend's story Animesh, Stay Strong!
Love your videos. Everything makes so much more sense now...
Thanks for your kind words Anthony :)
u taught so well. got the whole concept .....thanksss
Are you a university professor? If not, you should seriously consider it. You've managed to teach how to calculate time complexity better than any of my professors.
well he's harsha s. a top coder in the country of the time. yes the country. we'll always remember him. RIP Harsha Suryanarayana. you may have gone but your work will live on. long live humblefool
@@trueresources3847 Thanks for sharing. I just read the story, that's really sad.
thank you for making this so easy to understand.
Awesome! Where are the follow-up videos?
ruclips.net/video/ncpTxqK35PI/видео.html
You're among those few who provide playlist link in the description !
Thanks Madhu.
Very good, informative and excellent work. Keep going
Awesome Explanations !! Really helped a lot.
Thank you so much for such amazing content!
thanks bro this helped me get good grade from my exam today!
At 4:38, O(n+1) might come as loop would even check/compare i=n and then return false.... but it would use time in comparing! If n tends to infinity than we can neglect constant and keep it as O(n)
hi, at the end of this video you mentioned about the next video in the series "calculating time complexity of recursive programs". I cant find it. If you have uploaded more videos in the series please provide links to the complete series.
Thanks a lot Bro .... Really Appreciate your Efforts and very well explained.
Very Clear Explanation... Thanku so Much....
2020 and I watch this to increase my ability in computer science field for my job, since I am graduated from physics
best of luck man
Aweeeeeesome Explanation..I was missing that in my life..Keep going
You guys aer really awesome. Please continue to make. Love 😍
great tutorial. very good teacher.
This was very helpful. Thank you!
Thanks a lot Josey !
simple and clear explanation, thanks for the video :)
Hi, Thank you for such informative video. But can you give examples of codes that would at O(lg N), loops would be a certain indication of O(N), or O(N^2) but how about the others? For example, what is the running time of the prime function on your first video? and why? thanks.
Thanks brother ... Lucid and best ...
good job sir. very nice explanations.. keep doing
Thanks a lot, all the 4 videos wer very helpful...
Hello, in the tutorial we see O(n), O(n^2),O(n^3) time complexities. But when would you associate logarithmic functions to time complexities. When and how would u calculate that time complexity of a particular code is O(logn) or O(nlogn) ?
Thank you this cleared up a lot!
Hi Sir. First Thanks for making things crystal clear. I have a question, at last, we discussed the if and else and we took the worst case which is true for O. Instead of going to big O can we have solved that using theta that gives the tight bound ??
Hello sir.. u did lots of efforts to make us understand the above Complexity topic, but to make a perfectionist over this topic would you please upload some more videos over this topic by which we will get over all concept of complexity like log(n),log k(n),log b(n) etc related to this ..thank you so much anyways :-)
Thanks. Very very helpful.
please make video on implementation of calculating time in c++
So on the last part, supposing the condition was "if n
Boss you are great :)
Thank you so much for all detail explanation.....
2:49
I think here time complexity is O(log n).
Correct me if I am wrong.
Great Work Appreciated.
Excellent video! Thank you.
Thanks- very clear explanation!
for(i=0;i
+Aakash Varma it would be 0(n^2)
+Aakash Varma nlogn
Shivam Kashyap How?
+Rambo Rambo
it is nlogn. The nested loop only increments j upto log(n) then the loop exits, so the combined run time is n*log(n) = nlogn
the outer loop runs n times.
each time we run the outer loop, we run the inner loop since j is always set to 0 and it increments by 1 until it reaches logn (so it runs logn times)
so we do the whole thing is (times you run outer loop) * (times you run inner loop) = n * logn
thanks for good video series on time complexity, you said next video, means it will coming into this playlist?
thanks for making this video, very helpful!
so clear explanation, my question is that what if we have the following loop
for( i = 0;i
You need to see, how many times the inner loop will run. it will be n-1 times for i =0 , n-2 times for i=1 and so on. So, total will be (n-1) +(n-2) + (n-3) + ... + 1= n*(n-1)/2 which will be a polynomial expression of form an^2 + bn + c for some constants a,b and c. For such time expression highest order matters. So O(n^2)
mycodeschool Ok, thanks a lot. do you have video in the lower bound -big omega-?
IBRAHIM ALGHAMDI Like an example, or something
Awesome explanation
..
It was very helpful thanks a lot to u....
Great !...explained nicely!
But As you said that big-oh represents the set,then how can they be added?there should be a union between them.And then in set terms,there is nothing like lower order terms,so they can't be ignored.
Next video?
log(n) complexity?
Great job btw!
gr8 tutorial guys, can you redirect me to any other of your videos where the running time of actual program is calculated, It will be great if there are examples and questions , thankx