Тёмный

Big O Notation 

HackerRank
Подписаться 266 тыс.
Просмотров 1,7 млн
50% 1

Learn about Big O notation, an equation that describes how the run time scales with respect to some input variables. This video is a part of HackerRank's Cracking The Coding Interview Tutorial with Gayle Laakmann McDowell. www.hackerrank.com/domains/tut...

Наука

Опубликовано:

 

26 сен 2016

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 567   
@codinginflow
@codinginflow 6 лет назад
So Big O is not a rapper?
@allenllewellynkra
@allenllewellynkra 6 лет назад
That's Big L
@user-mn3iq2cs9n
@user-mn3iq2cs9n 5 лет назад
Good one. Is the world ready ? What do we call it. Dat-rap? Chip-hop?
@rbp365
@rbp365 5 лет назад
That's Lil O
@ChildishJordino
@ChildishJordino 5 лет назад
haha
@mainpost4111
@mainpost4111 5 лет назад
You're thinking of The Notorious BIG O.
@christinehill4584
@christinehill4584 6 лет назад
Here's my favorite Big O analogy: Let's say you're making dinner for your family. O is the process of following a recipe, and n is the number of times you follow a recipe. O - you make one dish that everyone eats whether they like it or not. You follow one recipe from top to bottom, then serve (1 recipe).
@shubhamnegi1937
@shubhamnegi1937 6 лет назад
Chris Hill, good analogy. For O(log n) one dish is being served to all the groups or a dish for each group?
@B-Billy
@B-Billy 6 лет назад
One dish per group.
@me-zz2340
@me-zz2340 6 лет назад
O(n^2) analogy is not very good. I think if every person in your family makes individual dish for every person (so every person will have n dishes) - this could be O(n^2)
@spray-r9951
@spray-r9951 6 лет назад
This analogy is fire!!!
@flybeep1661
@flybeep1661 6 лет назад
Simon WoodburyForget I guess you don't know what an "analogy" is. You just explained it in your way without making an analogy at all. Using analogies is a way to describe complex concepts in an as simple as possible way. The simpler the explanation the better the analogy. You just explained it in a fashion you would understand it best which isn't necessary the best way for others. Making anlalogies circumvents this problem. I hope you're not a teacher, you wouldn't be good at it.
@lassulfi
@lassulfi 5 лет назад
PTP - Pigeon Transfer Protocol
@akoshileolalekan5364
@akoshileolalekan5364 2 года назад
LOL
@FluffyNinjaUnicorn3Gaming
@FluffyNinjaUnicorn3Gaming 2 года назад
YES!
@dakshdangwal
@dakshdangwal 2 года назад
ah yes
@pmoney8701
@pmoney8701 2 года назад
I’d buy it😆
@mrkinetic
@mrkinetic 2 года назад
But did they account for the time to transfer the data on and off the drive?
@joe44850
@joe44850 6 лет назад
I might be too stupid to be a software developer. Unfortunately, I have learned this after 20 years of being a software developer. There are some things you need to know to impress people interviewing you that you may never touch on the job.
@fierce10
@fierce10 6 лет назад
An older interviewer who was a director at a company failed me because he asked a question on this and he didn't know to drop coefficients. He insisted in the interview that its O(2N) and I got it wrong by saying its O(N).
@spray-r9951
@spray-r9951 6 лет назад
You probably are
@rxtx3948
@rxtx3948 6 лет назад
sometimes it feels frustrating that the interviewer knowledge is limited and he is just denying the same fact.
@danbo967
@danbo967 6 лет назад
My take on all this is this, if you work for a company that processes few records (entities, etc.) you usually are fine without complex algorithms unless you have to do complex operations. If the company processes a lot of records it becomes increasingly helpful (O(N)... did you get it ) to use algorithms and Big-O notation. Especially for companies that are algorithm intensive like Amazon, Facebook, Google, etc.
@funinchico84
@funinchico84 5 лет назад
No. It allows you to *prove* that an alternative is more/less efficient. If a developer can only come up with O(n^2) solution, then big O can tell you it's slow. Which is exactly what my computer can tell me with benchmarks. There's a benefit to knowing the notation, but it doesn't automatically make your code more efficient.
@user-gp8fr1nd3w
@user-gp8fr1nd3w 4 года назад
oh my god for the first few minutes I thought it is an ad.
@CodeWithYubraj
@CodeWithYubraj 2 года назад
lol me too
@jameswon5497
@jameswon5497 6 лет назад
Thanks so much, this 8 minute video made it way more clear than several hours of lectures and readings
@connergesbocker9902
@connergesbocker9902 7 лет назад
Gayle!!! I just started reading cracking the coding interview and what a pleasant surprise to stumble upon this channel. Great educator and author. Thanks for the video :-)
@yongaisim6845
@yongaisim6845 6 лет назад
What a simple but clear explanation on Big O. I finally found you. Many videos start off with even more complex mathematical terms that are difficult to understand by themselves. You start very simply. Magnificent! How about one on Tractability to help.
@extremeloco23
@extremeloco23 6 лет назад
Clicked this because it was 8 mins, straight to the point, no unnecessary knowledge. Loved it
@Ankit-zu2kp
@Ankit-zu2kp 6 лет назад
Yeah, I just hate to watch those one hour long explanations.
@10uRization
@10uRization 4 года назад
Although you left some other necessary o notations, your lectures are great! I'm glad i found your lectures, straight to the point and an understandable dialect.
@mobileappmike
@mobileappmike 4 года назад
Good video. People say McDowell's lessons aren't important and are never used outside of interviews, but big O notation is actually important. I learned this the first time I used nested for loops.
@Dmasha28
@Dmasha28 5 лет назад
This makes me realize Colt Steele's a legend. I came here after watching his tuts on big O and I was surprised at how much I already knew
@theBIGgee
@theBIGgee 4 года назад
He's d greatest
@akashgkrishnan9596
@akashgkrishnan9596 3 года назад
true that
@swissmatteo
@swissmatteo 5 лет назад
Even though I've had to survive from programming for all sorts of clients for almost 15 years, I now find myself having to learn these things if I want to settle down, get a job with a six figure salary. Truly nothing wrong with this, even though I've been told that I'm not a senior programmer. Which is correct, but I'm a senior in relationship development, sales, customer support, tolerance, fixing programming issues, doing whatever it takes to get the job done, and building real world applications. It's hard to tell an interviewer that has no real world experience these things without telling them to F off. I've disregarded my big Ego, and have been studying these things, taking online courses for Golang, and I now feel more confident that I can compete with my vocabulary and understanding of the computer science mumbo jumbo. It's truly an exciting step because after you learn just the bits and pieces, you indeed put yourself in a position to earn a wonderful living as a programmer. Wish you all the best of luck on your endeavors.
@PauloHenrique-pk5ro
@PauloHenrique-pk5ro 2 года назад
How you doin' mate
@swissmatteo
@swissmatteo 2 года назад
​@@PauloHenrique-pk5ro Absolutely phenomenal. 2022 brought along with it some new experiences and opportunities. And yourself?
@PauloHenrique-pk5ro
@PauloHenrique-pk5ro 2 года назад
@@swissmatteo I feel happy for you! I'm just an 18yo Beginner studying Basis Concepts to start Programming... Also trying my way to college, I'm nobody, yet. 😅 Care to share your GitHub Profile?
@user-xn6jm1gz7l
@user-xn6jm1gz7l 2 года назад
Absolutely mate i hope you're doing well!
@volo7
@volo7 7 лет назад
that introduction really helped put this subject into perspective
@Wiejeben
@Wiejeben 7 лет назад
Thanks for giving an explanation that someone without much knowledge of maths understands by giving practical examples :-)
@vishalsoni6409
@vishalsoni6409 2 года назад
Excellent explanation! Thanks for simplifying Big O concepts.
@marie2136
@marie2136 5 лет назад
Wow, Thank you sooo much! This video helped me a lot for studying for my finals.
@Owen-
@Owen- 6 лет назад
HOLY SHIT, THANK YOU SO MUCH. So wish you were my lecturer cause this made so much more sense than anything he ever said!
@jeanliu6762
@jeanliu6762 5 лет назад
A very concise and to-the-point video. Thanks!
@kaieden
@kaieden 7 лет назад
The pigeon/Internet anecdote bears a striking resemblance the plot of Terry Pratchett's 'Going postal'
@NooglerNafiz
@NooglerNafiz 2 года назад
Such a revolutionary explanation of Big O.
@changeorbeextinct
@changeorbeextinct 5 лет назад
Great explanation of Big(O). This is important for any programmer to understand the efficiency of the algorithm. I know many excellent programmers who don't have CS degrees and may not know the academic description of Big(O). But they know it intuitively through experience. Having said that Bg(O) is an easy concept to understand, requires practice to know how to assess efficiency and scalability of the code.
@itsaaron6423
@itsaaron6423 Год назад
Nah
@matexxo4004
@matexxo4004 6 лет назад
I've studied many ressources on that subject, but it's finally on yours that I got the concept. Cheeeeeeeeeeeeers!!
@shehrozeshahzad581
@shehrozeshahzad581 Год назад
The best video after spending hours I finally understood the big O!Thanks
@LBC_squared
@LBC_squared 3 года назад
Such a great explanation. I can flip a string with xor but I couldn't get Big O for the life of me. The meaningless N got me so confused before. Thank You!
@MrMrWazzaa
@MrMrWazzaa 4 года назад
HackerRank: Hi, Im Gayle Laakmann McDowell, author of Cracking the Coding Interview. me: i am aware
@KJ16ish
@KJ16ish 6 лет назад
Really creative explanation for solidifying our basics. :)
@francisaiello6197
@francisaiello6197 5 лет назад
Gayle - I'm curious what tool you used for drawing the various slides. Looks like it might be a freehand drawing tool and looks great.
@jessicalaursen1790
@jessicalaursen1790 6 лет назад
Straightforward. Easy to understand. Cool graphics! Hats off =)
@Michael-AC
@Michael-AC 2 года назад
Me: Man, I'm so confused by this class. What the heck is Big O? Gayle: Let's talk about one of my FAVOURITE things! Me: *feels even worse about struggling*
@michaeljeffrey5382
@michaeljeffrey5382 2 года назад
**fake laugh**
@MrMukulpandey
@MrMukulpandey 2 года назад
Wtf.....watched so many videos to understand this concept....and here u are explaining the same topic in an easy way...❤️❤️
@TheN0odles
@TheN0odles 7 лет назад
I'm from SA. I remember this 'exercise'. My brother even did a cartoon about it :-) Anyway, good explanation. Thanks.
@sindhusasidharan6762
@sindhusasidharan6762 2 года назад
Thank You for this video. I reached here after checking many other links .This is the best .
@awaisn
@awaisn 5 лет назад
i need this type of teaching. Fun, understandable and useful.
@stephenday4834
@stephenday4834 2 года назад
This is a wonderfully clear explanation.
@chris9300
@chris9300 6 лет назад
I enjoyed this. As a person who didn't have a background in Math or CS, this was very understandable. Now, I just need to remember and practice.
@stefkodak
@stefkodak 2 года назад
I really love this video, they really did a great job here.
@JonathanMontgomery77
@JonathanMontgomery77 4 года назад
We need some O(log n) and O(n log n).
@supastar25
@supastar25 4 года назад
Thank you sooo much for this...so to the point and simplified
@TheGoldenHawkz
@TheGoldenHawkz 4 года назад
Love your video! very clear and concise
@Yetipfote
@Yetipfote 5 лет назад
props to the bumpy pigeon animation. I had a good chuckle. Also very good explanation
@loganthompson7461
@loganthompson7461 3 года назад
You had to be an amazing note taker in school. Thanks for the explanation
@santoshsco
@santoshsco 2 года назад
Thats a great explanation , supercrisp and helpful for interviews .
@jordi5316
@jordi5316 3 года назад
i love this woman, she helped me so much
@inframatic
@inframatic 6 лет назад
I have seen this and read Cracking the Coding Interview 6 and this explanation is far far far superior, but the book explains O(log N) and more complex algorithms
@tekamanurag6065
@tekamanurag6065 2 года назад
This is what I needed to level up thank you soo much.
@anikdas7434
@anikdas7434 6 лет назад
best lecture i have seen so far
@kris4117
@kris4117 3 года назад
Well explained about representing O as a function of N under different scenarios.
@latedeveloper7836
@latedeveloper7836 2 года назад
1:35 Describing the pigeon transfer speed in Big O notation 2:00 What Big O is as an equation - scales linearly with respect to the amount of input 2:10 Summary of Big O 4:35 4 important rules for Big O Notation 4:40 Why Big O is related to factorial (I think)
@howdoyouturnthison7827
@howdoyouturnthison7827 2 года назад
For 4.40 : Cpu follow the steps one by one so you add them up.
@saisaketh7243
@saisaketh7243 5 лет назад
Amazing explanation!! Please post more videos..
@rishikeshsarangi1245
@rishikeshsarangi1245 4 года назад
Thanks , the concepts are now clear , time to solve questions
@srinivasnangunuri1313
@srinivasnangunuri1313 7 лет назад
Love your Graphics and Colors that are used for the Demonstration . makes it interesting to watch .
@spray-r9951
@spray-r9951 6 лет назад
i agree!!!!!!!!
@ThiruSings
@ThiruSings 7 лет назад
Finally I understood Big O - Thanks a ton !!
@subhamengine1143
@subhamengine1143 3 года назад
fav video for the concept.. gonna recommend to all my juniors.
@elenegulordava1868
@elenegulordava1868 7 лет назад
Great explanation! Easy way to get it.
@daramolapraise
@daramolapraise Год назад
“DON’T BE LAZY!!!” is right. I was lazy for my Google interview because of the low stakes (I already have a job I am happy with) and fumbled almost every BigO question. It came up in every round. I knew which was faster intuitively, but found it hard to represent the correct notation. Learn this as it is very very important to fully grasp it. Also, know the BigO notations for most of the built in functions for your chosen language.
@vincentbuscarello1357
@vincentbuscarello1357 7 лет назад
Very strong overall explanation. What are the chances of getting a video showing some real world giveaways for more complex Os, like O(log N) etc?
@Jerkwaad
@Jerkwaad 7 лет назад
O(sx)
@evantheking
@evantheking 7 лет назад
the chances are O(NO)
@igrewold
@igrewold 7 лет назад
Chances = Big O / 0
@bik8353
@bik8353 7 лет назад
chances - Big NO
@hellolin324
@hellolin324 6 лет назад
Binary search on an ordered array?
@ritickmadaan
@ritickmadaan 4 года назад
Its a really helpful video, made the concept pretty clear the only one thing is that it would have been better if an example of O(log(n)) would have also been there
@CaseyMartin
@CaseyMartin 2 года назад
I appreciate the bird moving at the end. Fun touch.
@gabrielpereiramendes3463
@gabrielpereiramendes3463 5 лет назад
Very Good. Thanks from Brazil!
@krissaurixsent7988
@krissaurixsent7988 2 года назад
Great video, good theme the big O notation is very interesting
@AlexLaird7
@AlexLaird7 7 лет назад
Great explanation, thank you
@mikeromani608
@mikeromani608 6 лет назад
Great explanation, thanks!
@mayank_upadhyay_19
@mayank_upadhyay_19 4 года назад
Once, I used to thought that algorithm efficiency is not going to be a problem for me. ***believe me, I learned the lesson, hard way***
@hopeklein6537
@hopeklein6537 4 года назад
How d'you find out? What d'you encounter?
@haitham5104
@haitham5104 5 лет назад
thank you for the clear explanation
@akhilk5121
@akhilk5121 7 лет назад
Great colors!😊
@nanophyr_4468
@nanophyr_4468 3 года назад
Nice point to highlight at 6:23 .. it's small but I caught out doing this in an interview before.
@tmustafad
@tmustafad 6 лет назад
amazing explanation. thank you
@milindbebarta2226
@milindbebarta2226 4 года назад
Very good explanation. Subbed!
@vishvedula1
@vishvedula1 7 лет назад
Well explained, thanks :)
@allenllewellynkra
@allenllewellynkra 6 лет назад
Best explanation I've seen
@Fan-fb4tz
@Fan-fb4tz 3 года назад
This is the clearest intro on Big O
@JagjotSingh
@JagjotSingh 5 лет назад
I studied this in my CS course 15 years back. After that I never got a chance to use it in practice.
@NuisanceMan
@NuisanceMan 5 лет назад
3:20 Always good to see someone who knows how to draw a square...
@hanats
@hanats 4 года назад
it is a square, just not drawn to scale.
@FeLiNe418
@FeLiNe418 4 года назад
perspective
@DarianBenam
@DarianBenam Год назад
Really good explanation!
@mikhailsidorov8689
@mikhailsidorov8689 14 дней назад
Thank you for such a good, short, and comprehensive explanation of the big-O notation. It was really helpful. I just wanted to clarify my understanding: according to rule 3 (different inputs => different variables), in the rule 4 explanation, there should be O(a + a*b) => O(a*b) instead of O(n + n^2) => O(n^2), shouldn't it?
@sumitkumar-el3kc
@sumitkumar-el3kc 4 года назад
Thank you, it was really helpful.
@deepakp2641
@deepakp2641 6 лет назад
Great explanation!
@stoopydmynd
@stoopydmynd 3 года назад
Finally a good explanation! Couldn't understand it with my lazy ass teacher... Thank you!
@msesbreno
@msesbreno 3 года назад
Big O explained using a pigeon! What the heck! It’s so simple yet so effective that I want to cry. Thank you, Gayle! You are a gift to all programmers!
@rastogitech1
@rastogitech1 6 лет назад
I liked last four points to calculate asymptotic notation value.
@shawnmofid7131
@shawnmofid7131 2 года назад
I loved the story as well as the explanation. I also knew the pigeon is going to win:-)
@nipunasudha
@nipunasudha 5 лет назад
nice refresher, thanks
@haoyuli6006
@haoyuli6006 6 лет назад
Thanks so much, its life-saving
@allanhenriques2694
@allanhenriques2694 3 года назад
you use non dominant dropping when you take the run time of the nested for loop itself right?, it should be a*b + a and you drop the non dominant 'a' to get O(a*b). You should explain that earlier, but fantastic video
@CoryTheSimmons
@CoryTheSimmons 7 лет назад
If I understand this right, we should run benchmarks when nesting loops inside of loops (add more data to our tests and see if the increase is exponentially rising). It's really easy to exponentially slow down processes, and there's usually a clever, more performant, path.
@tear728
@tear728 6 лет назад
An easier way to do it is to find the complexity of the algorithm mathematically and then from there on you know exactly what you're dealing with.
@momentouscrazynoob1709
@momentouscrazynoob1709 Год назад
thank you! It really cleares stuff up :D
@mrrock3679
@mrrock3679 6 лет назад
I've noticed the books in the background were written each one in the different language, so I can suppose you read/listen/speak two or three idioms besides the English, right?
@GlynNormington
@GlynNormington Год назад
Very good, thanks. Please note that sometimes people pronounce O(1) as "order 1", O(n) as "order n", O(n^2) as "order n squared", etc.
@nandatkumar
@nandatkumar 7 лет назад
Just Great Explanation..
@MPKDilshan
@MPKDilshan 11 месяцев назад
Thank you and it is really helpful.
@CyberGenious24
@CyberGenious24 7 лет назад
Thanks for clear explanation ..
@thinhle1339
@thinhle1339 7 лет назад
Very comfortable to understand. One thing i considered that: why we removed the instants -> O(50n) = O(n) ? Admit that the results wont depend much on instants but how ab the instant with >1000 ? It's matter.
@crewlylehintal9451
@crewlylehintal9451 7 лет назад
That's because you haven't studied Big O notation in depth. This video doesn't explain what Big O actually is or where it comes from. Big O notation is defined in terms of set theory. O of a function let's say g(n), O(g(n)), is defined as the set of all functions f(n) such that there exists constants c and n0, where cg(n) is greater than or equal to f(n) for some n > n0. Big O is not necessarily defined for algorithms, it's defined for all functions as an asymptotic notation. Edit: I suggest you study other asymptotic notations as well such as big Omega notation, theta notation, small o notation and small omega notation.
@jyrikgauldurson8169
@jyrikgauldurson8169 6 лет назад
That doesn't explain anything, that's just the formal definition in text which is better read in real notation. Also, sometimes constants do matter.
@ohsquirrels3727
@ohsquirrels3727 5 лет назад
Wait so is Big O the function for runtime, or the speed of runtime increase (the derivative of runtime)?
@jamespaz4103
@jamespaz4103 5 лет назад
That's why I used hashmap now instead of nested loops
@thekrisho
@thekrisho 7 лет назад
7:13 function whyWhouldIDoThis(array) {return lol;}
@CJRH1FILMS
@CJRH1FILMS 3 года назад
Error: unused variable. 'array' is not used
@arthurmazzi841
@arthurmazzi841 Год назад
Very nice video!
@nistr2
@nistr2 6 лет назад
I think it makes more sense to say you drop coefficients - not constants.
@mustafas126
@mustafas126 6 лет назад
lol truuu
@espressothoughts
@espressothoughts 6 лет назад
Chris A. Both get dropped
@JoseAguirre-ri8tg
@JoseAguirre-ri8tg 6 лет назад
Both of them get dropped.
@lancetschirhart7676
@lancetschirhart7676 6 лет назад
Both of those two things -- one, and also the other -- they both get dropped.
@wolfboyft
@wolfboyft 5 лет назад
n^2 = n * n, no constants|coefficients there
@leohaldan4915
@leohaldan4915 5 лет назад
nice examples thank you
@AzaIndustries
@AzaIndustries 5 лет назад
This is killing me right now in CS... I dropped out of school due to illness and did a test to get into uni years later. I know I can code and test the efficiency of my programs using these theories in practice. But if it ever gets asked of me in a interview to explain the proper math terms and lingo I'm screwed. I'll get it now but in the future I won't remember this stuff, I'll only remember the practice I've had with actual algorithm implementation and refactoring.
Далее
Big-O Notation - For Coding Interviews
20:38
Просмотров 410 тыс.
Algorithms: Memoization and Dynamic Programming
11:17
Просмотров 961 тыс.
World’s Deadliest Obstacle Course!
28:25
Просмотров 58 млн
FUN&SUN | Update 0.29.0 Trailer | Standoff 2
02:32
Просмотров 1,2 млн
Data Structures: Heaps
10:32
Просмотров 1,2 млн
Algorithms: Bit Manipulation
9:06
Просмотров 531 тыс.
Bubbles Whiting - Using Punch Cards - Hollerith and IBM
15:02
Learn Big O Notation In 12 Minutes
12:18
Просмотров 182 тыс.
Top 7 Algorithms for Coding Interviews Explained SIMPLY
21:22
ВЫ ЧЕ СДЕЛАЛИ С iOS 18?
22:40
Просмотров 118 тыс.