Introduction to Big O Notation and Time Complexity (Data Structures & Algorithms #7)
Вставка
- Опубліковано 28 вер 2024
- Big O notation and time complexity, explained.
Check out Brilliant.org (brilliant.org/..., a website for learning math and computer science concepts through solving problems. First 200 subscribers will get 20% off through the link above.
Special thanks to Brilliant for sponsoring this video.
This was #7 of my data structures & algorithms series. You can find the entire series in a playlist here: goo.gl/wy3CWF
Also, keep in touch on Facebook: / entercsdojo
I'm in my late 50s and starting a DS & A university course, and of course the first term I hit was "big-Oh" and when I saw the academic definitions it nearly triggered a panic attack. I am SO grateful for this engaging lecture and also immensely grateful that the Internet makes such valuable content available.
why are you not fishing or living in a hut
Why don"t u study instead of being rude@@Imsupposedtostudy
We're on the same boat, and this lovely tutorial also saved me from panicking! Keep on going my friend!
"I'm gonna use pseudocode"
**uses Python**
Python: "Am I a joke to you?"
UAHAUHAUHAUH
@@MrKiraBR yareet there pal?
Top 10 anime plot twists.
My professor does the exact same thing. Assignment: Write the pseudo code for a sorting algorithm and run it. You can’t run pseudo code!!
@@melvinsoto Sure you can. Make a state table where the columns are variables/registers/array elements etc and the rows are the state after the line number is executed. Treat the pseudocode as interpreted code, with you standing in for the interpreter, and track the state on the table as you 'run' the code.
The flow of your explaining is excellent. After getting frustrated from reading this from text books, I came here and now it looks so simple to understand. Really excellent man..☺
This is by far the best explanation of time complexity and how to calculate it for any function that I have seen on UA-cam. Thank you.
Sir, you are doing a really great job. I am able to understand each and everything in this tutorial. You put so much effort into your tutorials. I cannot thank you enough for this crystal-clear explanation. You even quit your job at google, just to teach and share your knowledge with us and that too for free, mad respect for that. Thanks again sir.
And can you also add O(logn) and O(nlogn)
No, it has to be a mapping inside O(). O(n -> logn) O(n -> nlogn)
@Youssef Zahir Data Structures and Algorithms in Python [Goodrich, Tamassia & Goldwasser]. Chapter 3
I have learning it at university at 2013 and i couldn’t understand this s***t. After ten years, i can proudly say i get it. Thanks you guy. You are genius. That’s the best algo complexity’s explanation that ever seen
I should be paying my tuition and fees to you lmao
Seriously, thanks!
Having to pay tuition for going to university/college must suck /🇸🇪
Cruzer ikr 🇳🇴
bro, my lecturer just explained it so poorly for 4 hours. And you just made it so understandable in half an hour! good job man thank you
Thank you so much for explaining this. I have a quiz on Big O analysis tomorrow and I was completely lost before watching this video.
when I watched this a week ago , I didn't quite understand this.Maybe because that was my very first time to learn Big O and time complexity.But this time,I really understand everything U taught.Thanks sir! and if there were someone out here who didn't understand this right away , don't be discourged.U will understand this when u watch next time.
I am not a computer science student, I have been struggling to understand BIG O Notation for month, this solve this in the simplest best of way. thanks a million
I really would love to see a explanation on the mathematical details!:) When i wrote programms for maths class I always myself how I could figure out how much time a certain Programm would Take to run and if it's even worth to wait for a result! Thank you for your video
Here is the more accurate mathematical definition of O(something):
Let be U(n) and V(n) two sequences then U(n)=O(V(n)) if and only if U(n)=W(n)×V(n) where W(n) is a bounded sequence in other words it exists a natural number 'N' and a real number 'M>0' where for every natural number 'n' with n>N then | w(n) | < M
This ( O( ) ) is used to approximate the behavious of a sequence with an other , in other words _ and in the case of time complexity _ the graph of execution time for an algorithms is very similar to the one of the expression inside the parentheses after big O.
Okay! Sorry I just saw this comment - I'll see if I can make it after my trip :)
++++++
I would love so too
same here
A very good and detailed explanation of Big O notation and time complexity. I'm a college student and I took Data Structure course before but the professor was suck so that I end up did not learn any knowledge about Data Structure. After I watched this video, I really hope that you were my professor at the time that I was learning Data Structure. Excellent video.
Where have you been all my life? You summed up in less that one hour what I have been struggling for weeks to learn. TY!
Hi CS Dojo really love your content!! Please make more content on python for people coming from other languages like java,c++ gives the differences in syntax, structure in OOP, control statements, inbuilt data structures and important libraries in it. Also missed you for so long !!!😻
Okay sounds good. Thank you for saying that!
CS Dojo my pleasure 😇 YK!! Thanks for making videos!!!
Sincerely, what a tremendous talent!
Took me 36 minutes to understand everything that I have been struggling to understand for weeks.
Thanks YK
Fuck that ***pp
Thanks Bro, I just cleared an interview with the help of this video. Love you from India
My professor, who has been teaching programming for 35 years, could not explain this concept properly and you just made it look so simple in just 30 minutes. Not all heroes wear capes, indeed.
Thanks for this!! Very helpful. And I suggest whoever thinks this is good should go through all the ads(that's what I do) so that Dojo can make more from this great contribution ;)
OMG you make it so simple to understand! Thank you. My professors need to take notes.
the teacher at my university is getting paid while this guy is the one who teaches me things correctly. it seems unfair.
It's a shame for me that I have worked with various types of projects but I don't know basic things like this, thank you, you just made my day! :)
Great video, I finally understand Big O and how to get it for my programs, the ending was exactly what I was wondering about, what if there's two equally growing highest terms.
Someone correct me if I got the wrong expression but since O(2n^2)=O(n^2) I think it's safe to simplify the initialization, addition and return of variables to O(1) when non scientifically determining the big O notation as it will probably never increase the notation more than it would have been anyway
I started coding two years ago after watching your videos, now I'm back and still getting so much out of your content. Thanks so much for creating this content.
I really understand more much better bigO now with your explaination than my lecturer did in college. I wish i knew your video several years ago and i hope i can achieve my dream for being a lecturer then teach these to my student so they can understand as much as i did. Thank you so much, may god bless you.
this is a great video!
one small correction: for the first find_sum function, i believe total should be total += array[i], rather than i.
other than that, great video! kudos to you.
I wish you were my university lecturer - so happy to have found this!! :) It made things make so much more sense!
Hi
Your teaching style is unmatched. Thank you for this video.
i have not understood this concept till this lecture,great tutorial ever , awesome! Thank You lot!
Oh hell, i hardly understood anything while reading about this topic in book, but here everything explained very clear! Thanks you so much!
I’ve been struggling with this concept but you explained it better than most!
UA-cam-U at it's finest! Thanks so much for the elegant explanation!
My drug is back!
お久しぶりY.Kさん!
These explanations are priceless! This video is highly UNDERrated.
Someone give this man a medal!!!
This video has literally cleared all my concepts on this topic. Thank you so very much CS Dojo!
The best video on Big O on youtube. Great explanation 👍
Your video simplified an entire university class😢thank you
I find books and universities will over complicated things just to make them longer. 😅
Hi, awesome video as always.
Thank you very much. Your explanation is so clear. Now I understand Big O Notation after long time confused.
Premiered in 2014 but as sweet in 2020. So relaxed, composed and to the point. I had to subscribe!
Can someone explain to me why I understand this CLEARLY whereas a traditional math class I couldn’t get through basic algebra? Or he’s that great of a teacher
I swear i never got this concept in college but YOU SIR are a legend. Thank you man.
Excellent explanation. This is far better than many paid courses. Thanks for such a quality content.
love this guy!!! my favorite UA-cam programmer all hail CS dojo
Thank you my frieng, You should be a proffesional tutor at some university. You make my college teachers look stupit. The way you explain everithing is so much easier to understang. Thank you very, very much.
Thank you a million times over. Excellent teaching.
Its amazing the way you simplified this complex term. Even a kid can understand this way. Please make video explaining complexity equations
Hi, this lovely tutorial also saved me from panicking! Thank you and keep on going please 🙂
I could not understand this for the life of me in our text. This helped so much.
Explained perfectly. I don't understand why it can't be explained this way in my CS courses...
Most appropriate explanation I have ever seen
Thank you YK, this really helped me understand Big-O notation.
Great vid, I love how Python is becoming everyone's psuedo code
U made it so easier to understand. Respect
which is the time complexity of the following sequence? and why?
int n, i, j, k, s=0;
cin>>n;
for(i=1; i
A huge "Thank you" from Italy
Thank you! My professor literally did not explain this at all. It just appeared in the activities..... It's like going to university so they make you find yourself everything....
Hello YK thanks for this great video, I would appreciate another video that explain the formal definition of big(O)and also more advanced topics on data structures and algorithm.
Thank you for making this video. You explain much better than my professor!
Currently studying for my Data Structures midterm a after this video I feel more confident about it!
mee too
Excellent presentation of Big O! Very clear and easy to follow, I plan to recommend this.
Now I know a bit of python code :D honestly we didn't cover this topic in curriculum we have. You are just the one who introduce it to me and I'm glad you are my prof because I easily catch up the topic you're discussing.
What if the row and column are not equal will it be O(mn)??
Stupid function 👌😂😂
My exact question too! And I think it would be linear O(n) where n = rows * columns
Ur way of teaching is really good
This video has been infinitely more useful to me compared to my professors who have spent 3 weeks trying to explain this to me. You're a legend, thank you so much :D
whitelisted your channel from my adblocker and watched your ads.... that's the best i can apparently do to help you :) THANK YOU!
Your explanation is simple and clear. What is the TOOL you are using? it enhances your teaching methodology.
This was my second Big 0 explanation video and it may be my last. Perfect!
Very helpful!! Loved the teaching style!!!
Thanks million for this wonderful and clear explanation !!
This guy is good at explaining
Simplest explanation. Thanks for the video
TNX man, you have a good head in explaining data structures.
Thank you🍁🍁Love from India💜
Would you say that the Time Complexity is basically the dimensions of the arrays we are using? For example, a single 1-dimensional array is O(n), 2 dimensional matrix array comes out to O(n^2) and a 3-dimensional array would come out to O(n^3)? Or would that also represent how many for-loops we are trying to use? 1 For loop would be O(n) and 2 for-loops would be O(n^2) and so on
Please professors, explain new concepts like this guy
Thank you so much. Now I understood and will practice!
Very good and timely video and education!
It's a super clear explanation to Big O! Thank you so much!
Thank you so much for this video! You explained this in very lucid way.
a legend. a legend, my guy
That was a brilliant detailed explanation. Thank you!!!
Thank u dOjO u make me understood bigO to me:)
This is very well explained, thank you.
I really enjoyed this video. Great Job!! It was a good refresher for me before I started interviewing. I was given some problems to solve as part of an interview and I nailed it.
Cs dojo can you make one crash course in data structures and algorithms?
JUST BRILLIANT! What a superb video to understand the topic, thank you very much!
I came here to learn about this big-O notation, but what I see a 31:41 seems wrong, maybe I've misunderstood something so please correct me if I'm wrong #CSDojo .
So let's assume your array_2d at every index has a single sub_array or 1 element, then even if you iterate trough it with those 2 for loops, is still 1 operation per sub_array, identical to the normal array case so O(n). Now in your example where you have each sub_array of size 4, you're still adding a linear ammount of element per each sub_array, therefore if your array_2d is size 5 (5 sub_array of size 4) you're doing `total += i` 20 times, and if your array_2d is size 10 (10 sub_array of size 4) you are doing `total += i` 40 times, array_2d of size 15 would be 60 operations and so on. Therefore this is linear and O(n). Am I wrong?
I wish u had a course ,or software engineer path, video playlist , you are really good at teaching
Thank you. The way you explain is very clear and understood. We are waiting more videos.
Just one word: amazing!
This is just simply awesome. Thanks
This was really helpful. Thank you!
I sincerely appreciate you recognizing the youtube majority as intellectually capable. I'm afraid many a modern university and public education system think otherwise.
Thanks man u made my day! I was stuck at this topic at my college and u made it easy for understanding. Please make more videos on data structures.
Great job explaining, was def rlly helpful
Really liked the video but I didn't get the equation for the linear time where T =an+b
Very concise explanation