I literally spend hours, looking through various videos to try and learn on new things and I never learn as much as I do from your videos man. I really don't know what is is, but the way you explain and teach, there is a simplicity to it that just makes everything click for me. Your channel has helped me so much throughout college and now its helping me prep for my first big interview, I really can't thank you enough man!
I've been looking for an explanation for this for like an hour now, and this video has by far been the easiest to follow along with and understand. Thank you very much.
Thank you so much my guy, you've simplified Big O notation so much for me and I can't even begin to express how grateful i am that you make these videos. Cheers!
Thanks kyle. Big(O) notation is something I have always got confused from multiple sources. This video is really helped me to understand with simple examples.
When I searched about time and space complexity, I saw some very popular channels videos and yours as well in that list. I clicked yours first cuz I trust your knowledge and your way of explaining things is way easier to grasp. Thanks a ton man!
Thank you! Web dev simplified has been my teacher since html and CSS! I'm now studying intermediate javascript and CS50 and he's still the guy that is helping me undwrstand everything ❤
One Example is the Binary Search Algorithm. It only works if the Array you are searching for a Value in is already sorted. Lets say the Value you are looking for is A. The first step is to take the Middle Value of the Array. If the Middle Value is equal to A then youve gotten very lucky and the Algorithm is finished but realistically that wont happen. If the Middle Value isnt the equal to A, you ckeck if A is larger or smaller than the Middle Value. If A is smaller, you "remove" the right part of the Array, if its bigger, you remove the left part. After that you take the new Array, and once again halve it and compare the middle Value and A, and so on and so on, until youve found your Value. The reason this is logarithmic, is because the number of operations isnt linear to the Array length. if you have 8 Values in the Array you will worst case scenario have to split it 3 times, but if you have 16 Values, you will only need to split it 4 times not 6 times, and if you have 32 Values you will only have to split it 5 times not 12 times.
Now that I think about it, as someone who does have a job, and have interviewed people before these kinds of question are not meant to be passed. at all, they're just a good excuse to have the liberty to pick which people you might like although there's gonna be exception to those who pass. that's a a different story. sure there's interviews that are sometimes have good intention, that's different too. not all companies are the same though, for some companies. these kind of question can be more of a necessity rather than a luxury but as more and more companies conducting these kinds of interview questions. they're become more of an excuse. not to mention if the person asking the questions even knows what they're talking about in terms of these nuance points, not just comparing them to textbook answers sometimes if not a lot the interviewee are as clueless when it comes to these questions and just treating them as basic checkmark. awesome videos btw, I always enjoy your content.
Indeed , in web-dev, where things change every 2-3 years, you dont need any of that computer science maths to execute the demands of your boss/client for his web page or app. In fact, technical question in interviews are meant to see how you would handle talking about technical stuff in group settings were they to hire you : Are you a snob intellectual who likes to flash his technical knowledge in an unpleasant way to other coworkers who are not that nerdy? Hiring people is about good chemistry and personalities! Interviewers are looking for people who will fit with the team's member personalities without big ego clashes!! Conclusion: Dont try too hard to impress you're not impressing anyone just be yourself and be honest about how you'd go about tacking a problem while being positive and joyfull: Boom ! You got the job!
That's not entirely true. It depends on the position of the job. If I'm hiring for a senior developer or an architect, I expect them to know these questions as it's important they can create solutions that are performant and efficient, whether they implement it or not.
Which language is best for learning, data structures and algorithms. I'm very good at javascript. & very familiar with java & c. Please somebody HELP ME. as I have to continue with js or java or c.
I'm a graduate student in statistics self learning data structures and algorithms. This is a great example. I'll note that it's also very intuitive from calculus. For any self learners without a STEM background I feel a business calculus textbook (without trigonometry) might be helpful to quickly understand limits
One mistake I realized in the video is @9:53... You said the code written is constant. But it is actually linear. Although the outputs are constant, the code still has to run through the for loop. Which gives the code a Linear time complexity. Other than that you did a great job explaining this lesson. Thanks!
I laughed when you introduced this video by saying "...so you can walk into your next interview...". This does come up in interviews, but it is obviously important to understand time & space complexity of anything you run in a browser. Kyle did a good job of explaining that later on in this video, but I did chuckle when the video started. :)
Correction n^2 grows quadratically, which is polynomial, not exponential. In short big O notation is the most significant component of the algorithm complexity function, which represents the amount of computation required(worst case usually) for a given input size. I.e. it's the shortest way to express algorithm complexity, without writing the entire function of it, which makes it easier to compare. Comparing algorithms becomes as easy as: O(n^n) > O(a^n) > O(n!) > O(n^a) > O(n*log(n)) > O(n) > O(log(n)) > O(a) Space complexity is usually not a concern, simply because it's pretty much unusable for anything > O(n^2) for any meaningful input size. I.e. you can't really use such algorithms unless they are in the very efficient side of the scale. But yes you can use such notation to illustrate any type of complexity. Time, space, calls(i.e. non local time) and so on. To be fair it's not much better for the usability of time complexity algorithms. While you can do slightly higher power polynomial time complexity algorithms it's still polynomial ones or faster that you can run with any meaningful input sizes. I really think you missed the opportunity in this video to illustrate how fast the amount of computation requirements grow with complexity even for small n=50. n=3 is silly really for algorithmic examples and won't impress anybody even with a O(n^n) algorithm it's 3^3=27
your video's help me lot usually I never preferred to watch video's for learning but when I started watching your video its really easy and understandable for me. Your content is very simple and short and understandable Thanks for making this
Oh man, thank you very much! I was trying to learn alone, but some books about algorithms and data structure think that you have Big O notation previously, and many explanations that I found were so complex.
I wished you would have been making Videos when i was in College - you are able to explain things that Took me hours to understand so well, quick and precise, It would have saved me so much time! Nevertheless, I Like watching your Videos even If i think that i know Whats going in just to make sure i keep in touch with different topics and basics :)
Not convinced with this crash course Didnt explain the other types of time complexity like O(nlogn), O(logn), O(2^n). Not to mention space complexity is another important concept that should have been touched. Knowing only time complexity alone wont give a guaranteed success as a developer since memory consumption analysis matters as well.
you are so good in explaining ...Can you make full playlist on course (data structure and algorithm) with code , because I think its more important to a computer science student (2)
Correct me if I'm wrong, but console log something n times still gives you time complexity of O(n) as you perform some action n times. It makes no difference if that is console log something or creating new object. O(1) gives you result in the same amount of time regardless of the size of your input
This video is old but I didn't understand why it is O(1) instead of O(n) at 9:40? Is it because data[i] is already allocated in memory but data[i] + data[j] is a new variable that uses a new space?
I literally spend hours, looking through various videos to try and learn on new things and I never learn as much as I do from your videos man. I really don't know what is is, but the way you explain and teach, there is a simplicity to it that just makes everything click for me. Your channel has helped me so much throughout college and now its helping me prep for my first big interview, I really can't thank you enough man!
This is the best programming channel on UA-cam.
I agree. Simple & straightforward.
facts, my go-to every time
This is the best and simplest video I ever found about Bio O Notation. Thank you man
I've been looking for an explanation for this for like an hour now, and this video has by far been the easiest to follow along with and understand. Thank you very much.
Thank you so much my guy, you've simplified Big O notation so much for me and I can't even begin to express how grateful i am that you make these videos. Cheers!
Thanks kyle. Big(O) notation is something I have always got confused from multiple sources. This video is really helped me to understand with simple examples.
I wached lots of videos , but I didn't get a clear view. but Now I got.. Thank you man.. ! respect..
When I searched about time and space complexity, I saw some very popular channels videos and yours as well in that list. I clicked yours first cuz I trust your knowledge and your way of explaining things is way easier to grasp. Thanks a ton man!
Thank you! Web dev simplified has been my teacher since html and CSS! I'm now studying intermediate javascript and CS50 and he's still the guy that is helping me undwrstand everything ❤
man...my mouth literally dropped when you explained the part I NEVER understood about this in a way I finally can understand...
what about O(log n) how would you explain it? and what the example of the algorithm that represent O (log n) ?
One Example is the Binary Search Algorithm. It only works if the Array you are searching for a Value in is already sorted. Lets say the Value you are looking for is A.
The first step is to take the Middle Value of the Array. If the Middle Value is equal to A then youve gotten very lucky and the Algorithm is finished but realistically that wont happen. If the Middle Value isnt the equal to A, you ckeck if A is larger or smaller than the Middle Value. If A is smaller, you "remove" the right part of the Array, if its bigger, you remove the left part. After that you take the new Array, and once again halve it and compare the middle Value and A, and so on and so on, until youve found your Value.
The reason this is logarithmic, is because the number of operations isnt linear to the Array length. if you have 8 Values in the Array you will worst case scenario have to split it 3 times, but if you have 16 Values, you will only need to split it 4 times not 6 times, and if you have 32 Values you will only have to split it 5 times not 12 times.
This is the best explanation I have ever come across for learning Big O Notation! Keep the great content coming!
Thanks a lot for the demonstration of Big-O with coding examples. Now, it is super clear to me.
best channel for programming !
This is how you explain concepts like these. Highly appreciate your effort.
That's why I clicked bell icon.
Coz only you know what we need.
Thanks Kyle for making this 😍
You are Superman.
I legit don't use the bell icon for anyone because fuck getting youtube notifications. Except this channel.
@@chris94kennedy i know & never click anyone's bell icon. But this guy deserve it. His contents made me to do this.
Now that I think about it, as someone who does have a job, and have interviewed people before
these kinds of question are not meant to be passed. at all, they're just a good excuse to have the liberty to pick which people you might like
although there's gonna be exception to those who pass. that's a a different story.
sure there's interviews that are sometimes have good intention, that's different too.
not all companies are the same though, for some companies. these kind of question can be more of a necessity rather than a luxury
but as more and more companies conducting these kinds of interview questions. they're become more of an excuse.
not to mention if the person asking the questions even knows what they're talking about in terms of these nuance points, not just comparing them to textbook answers
sometimes if not a lot the interviewee are as clueless when it comes to these questions and just treating them as basic checkmark.
awesome videos btw, I always enjoy your content.
Indeed , in web-dev, where things change every 2-3 years, you dont need any of that computer science maths to execute the demands of your boss/client for his web page or app. In fact, technical question in interviews are meant to see how you would handle talking about technical stuff in group settings were they to hire you : Are you a snob intellectual who likes to flash his technical knowledge in an unpleasant way to other coworkers who are not that nerdy? Hiring people is about good chemistry and personalities! Interviewers are looking for people who will fit with the team's member personalities without big ego clashes!! Conclusion: Dont try too hard to impress you're not impressing anyone just be yourself and be honest about how you'd go about tacking a problem while being positive and joyfull: Boom ! You got the job!
That's not entirely true. It depends on the position of the job. If I'm hiring for a senior developer or an architect, I expect them to know these questions as it's important they can create solutions that are performant and efficient, whether they implement it or not.
Just taught me in 12 minutes what I’ve been stressing over for 2 days. Fair enough.
this is so well done !
I was waiting for all your data structure and algorithms videos and here start one. Love and support and care ❤️
I have another data structure video releasing soon as well.
@@WebDevSimplified will be waiting Kyle
@@WebDevSimplified please make a series of Data Structure and how to use in a project
Which language is best for learning, data structures and algorithms.
I'm very good at javascript. & very familiar with java & c.
Please somebody HELP ME. as I have to continue with js or java or c.
@@sandeepreddy6247 if you make project in javascript and apply data structure on it then start with it
I'm a graduate student in statistics self learning data structures and algorithms. This is a great example. I'll note that it's also very intuitive from calculus. For any self learners without a STEM background I feel a business calculus textbook (without trigonometry) might be helpful to quickly understand limits
That's our vintage Kyle doing what he does best, Awesome Videos of JavaScript & other cool stuffs like this !
One mistake I realized in the video is @9:53... You said the code written is constant. But it is actually linear. Although the outputs are constant, the code still has to run through the for loop. Which gives the code a Linear time complexity. Other than that you did a great job explaining this lesson. Thanks!
good video, easier to understand than watching an hour lecture where they talk about all the different things AROUND the actual topic
This was probably the simplest explanation of this topic.
Thank you!!!
Awesome explanation! Thanks, man
Perfectly explained!!!!!!!!!!!!
Thanks for such a great explanation!
Brother You are a LEGEND
Kyle you’re a legend
You are my frickin hero mate. JavaScript DS&A is like the bane of my existence. pls halp.
I laughed when you introduced this video by saying "...so you can walk into your next interview...". This does come up in interviews, but it is obviously important to understand time & space complexity of anything you run in a browser. Kyle did a good job of explaining that later on in this video, but I did chuckle when the video started. :)
i took 100 days but i did not understood how to learn big O but now i have learn it beacuse i found your vedio thanks
you explained so well. thank you
Thanks for the video, made Big O notation very simple and clear.
Very well explained for basic usage.
I liked it! The big O notation for recursion should have been added though.
[Wake up , See what Brad, Kyle and Ed are upto , Learn , Code , Repeat ] ; for (i=0; i
Thank you very good video, it is included as supplementary resource in my software engineering course.
private school quality explanation.
Correction n^2 grows quadratically, which is polynomial, not exponential.
In short big O notation is the most significant component of the algorithm complexity function, which represents the amount of computation required(worst case usually) for a given input size. I.e. it's the shortest way to express algorithm complexity, without writing the entire function of it, which makes it easier to compare.
Comparing algorithms becomes as easy as:
O(n^n) > O(a^n) > O(n!) > O(n^a) > O(n*log(n)) > O(n) > O(log(n)) > O(a)
Space complexity is usually not a concern, simply because it's pretty much unusable for anything > O(n^2) for any meaningful input size. I.e. you can't really use such algorithms unless they are in the very efficient side of the scale. But yes you can use such notation to illustrate any type of complexity. Time, space, calls(i.e. non local time) and so on.
To be fair it's not much better for the usability of time complexity algorithms. While you can do slightly higher power polynomial time complexity algorithms it's still polynomial ones or faster that you can run with any meaningful input sizes.
I really think you missed the opportunity in this video to illustrate how fast the amount of computation requirements grow with complexity even for small n=50.
n=3 is silly really for algorithmic examples and won't impress anybody even with a O(n^n) algorithm it's 3^3=27
This is AWESOME, would love to see more of these , thanks a lot for this video
You should do some advanced algorithm videos or introduce scaling concepts by using docker
your video's help me lot usually I never preferred to watch video's for learning but when I started watching your video its really easy and understandable for me. Your content is very simple and short and understandable
Thanks for making this
Wow, you have explained it so simply. Subscribed to your channel after watching this video
Thank You, my Friend. You saved me.
Oh man, thank you very much! I was trying to learn alone, but some books about algorithms and data structure think that you have Big O notation previously, and many explanations that I found were so complex.
Great video man, really helpful
Great job, Kyle. Awesome video.
This big O made me headache in the DS & intrO tO algOrithms cOurse
... that's capital O notation...
Flawless explanation, thanks Kyle!
Great video mate, but there is something I’m still a bit confused. Bear with me a sec.
This is the code:
For(int I=0; I
You are a lifesaver
awesome explanation
awesome explanation! really appreciate the simplicity of it.
great explanation
I have see some of the time ( log ) in big O but didn't find on your video, but your explanation was great hope you also explain ( log ) in future.
Great course ... took my ds and algorithms course about 2 years ago now great refresher!
You make it so simple. Wonderful!!. I thought Big O has some mathematical formula involved in it. Like the big one.
Shalom again.
Very nice!
Great explanation, thank you.
You are the best!
that was really helpful and handy, thanks a lot for making such video, it was easy enough and understood it one shot
Great video.. Good work.
Thank you for this! Very big help :)
Great video.
i like the way you teach... thanks my friend!
Thanks Kyle, very nicely explained, always had problems understanding the O notation
Well done, sir.
Thank you so much. This is really easy to understand. But how about the log ones
great job! thank u👍
I wished you would have been making Videos when i was in College - you are able to explain things that Took me hours to understand so well, quick and precise, It would have saved me so much time!
Nevertheless, I Like watching your Videos even If i think that i know Whats going in just to make sure i keep in touch with different topics and basics :)
You truly are amazing!!
really helpful thank you
wonderful , thank you
Please make more JavaScript algorithm I'm following you , your videos are so easy to understand,😍
You're awesome mate.
11:06 jata lol :) (really good teaching btw)
Thanks this is good!!
Not convinced with this crash course
Didnt explain the other types of time complexity like O(nlogn), O(logn), O(2^n). Not to mention space complexity is another important concept that should have been touched. Knowing only time complexity alone wont give a guaranteed success as a developer since memory consumption analysis matters as well.
you are so good in explaining ...Can you make full playlist on course (data structure and algorithm) with code , because I think its more important to a computer science student (2)
Hey man, just to let you know that I love what you are doing. You are great teacher. Cheers 🥂
Ur just rocking ...dude...learnt alot from ur videos !...just need some videos on...spring frame work 😃
Hello Kyle, this video very good. I'm from Brazil and I like your videos very much man. Thanks for videos 😁
Excellent
Question: For your answer O(n+a) at 5:52, can this be re-written to O(2n), which after removing the coefficient becomes simply O(n)?
Correct me if I'm wrong, but console log something n times still gives you time complexity of O(n) as you perform some action n times. It makes no difference if that is console log something or creating new object. O(1) gives you result in the same amount of time regardless of the size of your input
Sounds good to me. You can think of a single console.log operation itself (ignoring the for loop) as an O(1) operation.
Thanks!
Insightful
Thanks a lot man.
You are awesome buddy💯💯💯
Amazing!
Woah, I did not know Jordi was into computer science?!!
What would be the size of the Lester lopp example if you were using recursions instead?
Would it be the same?
only you can save my life Kyle, I own you
Thanks for this simple and effective explanation, I always stucked at these, But now i think its sorted😄
I came from cs dojo and while watching his video I saw a video of kyle on the right side of my desktop so without any hesitation I jumped into it.
lmao I have an interview tomorrow, thank you!
This video is old but I didn't understand why it is O(1) instead of O(n) at 9:40? Is it because data[i] is already allocated in memory but data[i] + data[j] is a new variable that uses a new space?
In case you still have this question, it’s because no new variable was created. So the data is logged but not stored, hence taking no additional space
Perfect!