More helpful than a 3 hour lecture. Thank you so much! Subscribed.
@NERDfirst6 жыл бұрын
Hello and thank you very much for your comment and support! Very happy to be of help :)
@KongLodden2 жыл бұрын
You just managed to explain in 20 minutes, what my professor could not in 2 hours. Best video I've seen on the topic.
@NERDfirst2 жыл бұрын
Hello and thank you very much for your comment! Glad to be of help =)
@MartianPotato2 жыл бұрын
I sincerely appreciate this content! I am taking an online class that is pure textbook reading and it's murderous. This video seriously saved me from hours of pain and suffering.
@NERDfirst2 жыл бұрын
Hello and thank you very much for your comment and support! Very happy to be of help, all the best for your class =)
@victoriajones89693 жыл бұрын
I was really struggling with some very dry literature on amortised complexity for my data science degree and this has helped a huge amount. Great work :)
@NERDfirst3 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@shashwathbhaskar6732 жыл бұрын
i had been trying to find good material for this topic and reading for different sources but couldn’t understand anything and then I came across your video and now have no doubts. thanks bro
@NERDfirst2 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@madanielmadaniel8 жыл бұрын
Dude, thanks a lot ! Your explanations are a zillion time more clearer than the best University professor :)
@NERDfirst8 жыл бұрын
+Daniel Madar Hello and thank you very much for your comment! That's great to hear, that means I've achieved what I've set out to do :)
@stevennery2337 жыл бұрын
This was such an excellent video. Thank you
@NERDfirst7 жыл бұрын
You're welcome! Very happy to be of help =)
@TamilSelvan-xf6ut7 жыл бұрын
OMG this' the best amortized cost analysis lecture I've ever seen
@NERDfirst7 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video!
@marcc11794 жыл бұрын
The best explanation of these 3 methods on the Internet! I watched a Corsera video but I did not get the point. Your video is more intuitive and clear! Thank you very much!
@NERDfirst4 жыл бұрын
You're welcome! Very happy to be of help =)
@garrettsmith22564 жыл бұрын
I'm studying for finals, and this was SUPER helpful. Thanks!
@NERDfirst4 жыл бұрын
You're welcome! Glad to be of help and all the best for your finals =)
@sinaazartash35664 жыл бұрын
Best video on youtube that explains amortization analysis so far.
@NERDfirst4 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@killerdoml76483 жыл бұрын
Im so grateful for this video! Thanks for explaining that topic so well. It was kompact, but every important detail was mentioned. Chapeau!
@NERDfirst3 жыл бұрын
You're welcome! Very happy to be of help and I'm glad you found it useful =)
@anabelsa6 жыл бұрын
You look so young, and yet you are better at teaching than most professors. THANKS!!!!!!!!
@NERDfirst6 жыл бұрын
Hello and thank you very much for your comment! Really appreciate the kind words! Very happy to be of help =)
@Aiyara_AoC6 жыл бұрын
Wholesome and amazing explanation, thank you ! I finally understand the bank account method which my professor and the MIT 6.046 video failed to make me understand. keep up with the amazing content !
@NERDfirst6 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@priyankitanwar34914 жыл бұрын
I genuinely cannot thank you enough for this! Thanks a lot man, thanks a lot :)
@NERDfirst4 жыл бұрын
You're welcome! Very happy to be of help =)
@justusmzb74414 жыл бұрын
Because of Corona my Algorithm & Data-Structure lecture was severely downgraded, and a lot of subjects were not covered... Thanks to you, i can still get some of that knowledge.
@NERDfirst4 жыл бұрын
Hello and thank you very much for your comment! Glad to be able to fill in that role for you =)
@qkunder4 жыл бұрын
Your example is surprisingly similar to the question I got in my assignment, just worded differently, which helped me to look at it from dynamic array perspective. Thank you a lot!
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Array expansion is a classic example for amortized analysis, so I'm not surprised! Glad to be of help =)
@pruthvirajjadhav40494 жыл бұрын
Best explained video ,I searched for shorter videos on this concept but they didn't explain in easy way .I wish I had watch this before❤
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Very happy to be of help =)
@lee-3-3 жыл бұрын
You're better than my professor !!! thank you so much
@NERDfirst3 жыл бұрын
You're welcome! Very happy to be of help =)
@yapchengyee9536 жыл бұрын
Cool explanation on the intuition of amortized analysis :D the rough idea does helps a lot in the understanding of the topic. Thank you very much
@NERDfirst6 жыл бұрын
You're welcome! Very happy to be of help :) What remains is to apply!
@siddarthathentu6894 жыл бұрын
Just amazing. What a great explanation! You just earned a subscriber.
@NERDfirst4 жыл бұрын
Hello and thank you for your comment and support! Glad you liked the video =)
@skittles64865 жыл бұрын
Wow. Wow wow wow wow wow wow wow wow wow wow...... I am speechless. Just speechless. You are a genius. Best video on this topic. I want to give this video 1 million likes.
@NERDfirst5 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@abhishekravoor4 жыл бұрын
This was the far best video on Amortized Analysis. Thanks a ton❤️
@NERDfirst4 жыл бұрын
You're welcome! Very happy to be of help =)
@tessacarstairs59983 жыл бұрын
thank you! You teach wayyyyy better than my professors do!
@NERDfirst3 жыл бұрын
You're welcome! Very happy to be of help =)
@tessacarstairs59983 жыл бұрын
@@NERDfirst you are so sweet!!!!
@ahmadfrhn976 жыл бұрын
i find it amazing when you can explain to me better compared to my lecturer in a 2 hour lecture. and heck most of the example came from your video 🤣 #keepUpTheGoodWork!
@NERDfirst6 жыл бұрын
Hello and thank you very much for your comment! The example given is the most classic example, that's why you'll see it common to a lot of explanations on this topic!
@didar3802 жыл бұрын
This saved me a lot of time. Appreciated!
@NERDfirst2 жыл бұрын
Hello and thank you for your comment! Happy to be of help =)
@elijahsawyers89507 жыл бұрын
Just subscribed because of this video...it's 100x better than my professor's method of explaining this concept. However, could you please explain how amortized analysis works for deleting elements in a dynamic array?
@NERDfirst6 жыл бұрын
Hello and thank you for your comment! I'm afraid it's not something I've given much thought to so I don't have an answer for you. However, I found something online that may be of use: www.cs.cmu.edu/afs/cs/academic/class/15451-s15/LectureNotes/lecture06/growing-shrinking-table.txt
@Twxwt6 жыл бұрын
This is the best video about Amortized Analysis! Thank you
@NERDfirst6 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@Kri387 жыл бұрын
thank you for making this video. the pace of the video was perfect.
@NERDfirst7 жыл бұрын
You're welcome! Very happy to be of help, and thank you for the feedback! Pacing is something I'm always very unsure about, so I'm glad to know ti worked well for you!
@MinhLe-xk5rm5 жыл бұрын
Awesome video on amortized analysis! Thank you!
@NERDfirst5 жыл бұрын
Welcome! Very happy to be of help =)
@natsableyourself5 жыл бұрын
Wow, very well explained. Please, keep them coming!
@NERDfirst5 жыл бұрын
Hello and thank you for your comment! New videos every week =)
@ppydpc4 жыл бұрын
Nicely presented! Very clear and well thought-out.
@NERDfirst4 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@mikevollenweider32794 жыл бұрын
Very clear and concise. Thank you!
@NERDfirst4 жыл бұрын
You're welcome! Very happy to be of help =)
@s78871773 жыл бұрын
This video is so awesome... save me a bunch of time to study
@NERDfirst3 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@firaseljerdy12445 жыл бұрын
Hello, great video! Just one thing. At minute 7:16, why did we inflate the numbers and forced an expansion? Could have we just done it with out the inflation? Thanks.
@NERDfirst5 жыл бұрын
Hello and thank you for your comment! The inflation starts from 6:30 actually. The reason why we do that is to create a series of additions 1+2+4+8+... instead of having it start as 4. This helps us see the pattern more clearly later on, where the total cost is almost 2x the number of operations (7:23).
@firaseljerdy12445 жыл бұрын
@@NERDfirst yes sorry I put the time wrong. Okay so this just for demonstration purposes? If we leave it as it is, can we prove that its the double without the inflation? Thanks
@NERDfirst5 жыл бұрын
Hello again! Personally I feel it is more convincing for a proof to start with an array of size one (ie. The "inflated" version as I have shown). Otherwise, you'll have to explain your arbitrary choice of starting array size, and you could be questioned about whether your proof holds true for smaller array sizes. The clearest proof shows that the _worst case time_ (ie. Even if we start with an array of size one), still gives us under 2x number of operations.
@tech-talks-with-ali5 жыл бұрын
Thanks for your explanations about amortized analysis. It was helpful for me :)
@NERDfirst5 жыл бұрын
You're welcome! Glad to be of help =)
@christianwu80424 жыл бұрын
Thank you so much! Extremely helpful video!
@NERDfirst4 жыл бұрын
You're welcome! Very happy to be of help =)
@mustafamohammadi57415 жыл бұрын
Perfect explanation. Great Job
@NERDfirst5 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@lightstrike74664 жыл бұрын
finally got that stuff :D my teacher failed explaining it for over a week now xD thx a lot m8!
@NERDfirst4 жыл бұрын
You're welcome! Very happy to be of help =)
@wentingyu60952 жыл бұрын
Thank you so much. I finally know the difference between accounting and potential in real examples and know how to calculate them now (cry)
@NERDfirst2 жыл бұрын
You're welcome! Very happy to be of help =)
@seireen9385 жыл бұрын
Helped me a lot for my upcoming test! Thanks a lot!
@NERDfirst5 жыл бұрын
You're welcome! All the best for your test =)
@Ashmole32 жыл бұрын
That was very clear. Thank you.
@NERDfirst2 жыл бұрын
You're welcome! Very happy to be of help =)
@TonyPepperoni273 жыл бұрын
Great explanation! Thank you
@NERDfirst3 жыл бұрын
You're welcome! Glad to be of help =)
@bpglogic2 жыл бұрын
Explained it so well. Kudos to you and subscribed:)
@NERDfirst2 жыл бұрын
You're welcome! Very happy to be of help =)
@forrest-forrest3 жыл бұрын
Wow this is great. Thank you so much!
@NERDfirst3 жыл бұрын
You're welcome! Very happy to be of help =)
@astaragmohapatra92 жыл бұрын
This was really helpful, thank you
@NERDfirst2 жыл бұрын
You're welcome! Very happy to be of help =)
@mahditalebi17704 жыл бұрын
great explanation! good job sir. very helpful
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Very happy to be of help =)
@hakan6449 Жыл бұрын
This helped a lot. Thanks! Initially I didn't want to click on this video because the thumbnail looked bad though. So if you made it better I think it would get more views.
@NERDfirst Жыл бұрын
Hello and thank you very much for your comment! I don't usually give a lot of thought to thumbnails, so this is valuable feedback - Could you elaborate more on what was off-putting about it? I'll see what I can do to make it better!
@CasanovaKingpin7 жыл бұрын
awesome video man ...very well explained each and every step .
@NERDfirst7 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video!
@高板丽奈单推人 Жыл бұрын
Bro you are a legend. 😭
@NERDfirst Жыл бұрын
Hello and thank you for your comment! Well, I'm glad you liked the video =)
@hedic4144 жыл бұрын
Thank you for this. So helpful!
@NERDfirst4 жыл бұрын
You're welcome! Very happy to be of help =)
@minh-trungtang77692 жыл бұрын
omg this deserves a subscribe thanks bro
@NERDfirst2 жыл бұрын
You're welcome! Glad to be of help =)
@samarthsudarshan48685 жыл бұрын
Great content!!
@NERDfirst5 жыл бұрын
Thank you very much! Glad you liked the video =)
@sonalipundpal6 жыл бұрын
The explanation was good...It really helped me
@NERDfirst6 жыл бұрын
That's great to hear! Very happy to be of help :)
@rakoonberry78795 жыл бұрын
Very helpful video. Thanks :)
@NERDfirst5 жыл бұрын
You're welcome! Very happy to be of help =)
@Daniel-iy1ed Жыл бұрын
Fantastic!!! Thank you so much
@NERDfirst Жыл бұрын
You're welcome! Very happy to be of help =)
@ronthedon2125 жыл бұрын
sir, thank you very much. this is a great explanation and great intuition content
@NERDfirst5 жыл бұрын
You're welcome! Very happy to be of help =)
@faxmunke97634 жыл бұрын
Thank you for the video!
@NERDfirst4 жыл бұрын
You're welcome! Glad to be of help =)
@nirajchowdhary73725 жыл бұрын
Thank You buddy you explained it very well!!
@NERDfirst5 жыл бұрын
You're welcome! Very happy to be of help =)
@mc37493 жыл бұрын
Thank you so much. this is super helpful.
@NERDfirst3 жыл бұрын
You're welcome! Happy to be of help =)
@satyadharkumarchintagunta37934 жыл бұрын
Sir,you explanation is tooooooo good🙂🙂🙂
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@hashankarunathilaka42295 жыл бұрын
Great content. Thanks a lot. It helped me big time
@NERDfirst5 жыл бұрын
Hello and thank you very much for your comment! Glad to be of help =)
@williamTjS3 жыл бұрын
Amazing video, thank you
@NERDfirst3 жыл бұрын
You're welcome! Happy to be of help =)
@MrEyee27 жыл бұрын
Why anyone would give this a thumbs-down is beyond me.
@NERDfirst7 жыл бұрын
Hello and thank you for your comment! I wouldn't worry about that =) What's important is that people have found this useful!
@Stuck.in.Matrix4 жыл бұрын
Great explanation.. thanks bro
@NERDfirst4 жыл бұрын
You're welcome! Happy to be of help =)
@UditPandyaIRZealot6 жыл бұрын
Simply Superb !
@NERDfirst6 жыл бұрын
Thank you very much! Glad to be of help :)
@fz82276 жыл бұрын
Very clear! Recoommend
@NERDfirst6 жыл бұрын
Thank you very much! Glad you liked the video =)
@benjaminmathew90614 жыл бұрын
Thank you! Question about accounting method - how do you decide how much to charge? I'm sure you're not randomly guessing or pulling numbers out of thin air. Is there a method to deciding costs?
@benjaminmathew90614 жыл бұрын
Same question regarding how you came up with the potential function
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! The way I see it, some amount of trial and error is unavoidable. A good gauge would be to consider how the expensive operations can be "divided into" a number of "cheaper" operations. Set up some numbers from there and try. If the number keeps increasing, consider assigning less to each operation. If the value dips below zero, then the cost must be increased. For deriving potential functions, it may be advantageous to first consider the aggregate method, which allows you to consider step-by-step costs which you can then "generalize".
@abelhecker3 жыл бұрын
thanks, it was very helpful :)
@NERDfirst3 жыл бұрын
You're welcome! Glad to be of help =)
@shil3316 жыл бұрын
thanks man, very good explanation
@NERDfirst6 жыл бұрын
You're welcome! Glad to be of help =)
@dharmilshah49344 жыл бұрын
It was a really great video and has given a great understanding for amortized analysis.... I just had one doubt, that why do we have 1 in (1+i) because 'i' is used for moving 'i' elements but likewise we are also inserting 'i' elements right?.. So shouldn't it be (i+i) ?
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Don't forget, (1+i) is discussed at a time when we're talking about what's going on *step by step* , in other words, on a *per-operation basis* . At any point of time, we are inserting 1 item only. However, there are some cases in which inserting that 1 item causes a chain reaction in which _i_ additional things happen. In that case, the amount of work done *for that one step* is (1+i).
@Tee_eej7 жыл бұрын
Great explanation! You are made to teach
@NERDfirst7 жыл бұрын
Hello and thank you for your comment! Glad you found my work useful =)
@vaibhavsingh10495 жыл бұрын
At 6:49 , wouldn't adding item 3 also trigger an array expansion?
@NERDfirst5 жыл бұрын
Hello and thank you for your comment! No, there will be no array expansion for the third item, as at that point, the array has a size of 4. After inserting "2", the now full array (of size 2), is transferred to an array double in size (size 4).
@vaibhavsingh10495 жыл бұрын
@@NERDfirst Thanks for replying so quick. I think I get it now.
@NERDfirst5 жыл бұрын
You're welcome! Glad to be of help =)
@dragonpig9842 Жыл бұрын
Great video! May I ask you what is a good way to come out with the potential function?
@NERDfirst Жыл бұрын
Hello and thank you for your comment! Unfortunately there is no "one rule" or method for doing that. You'll have to just get your head into the right space and reason it out. There's a good writeup here to start building that intuition: cs.stackexchange.com/questions/30543/what-is-the-intuition-behind-the-potential-function-in-amortized-analysis-of-som
@dhananjaynaik63915 жыл бұрын
Hey man. Thank you. It helped a lot.
@NERDfirst5 жыл бұрын
You're welcome! Very happy to be of help =)
@asefsgrd55735 жыл бұрын
Great video ever!
@NERDfirst5 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@kishore49945 жыл бұрын
Nicely covered
@NERDfirst5 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@blacklight8932 Жыл бұрын
13:56 You have defined this function but how? How do I define phi(h)?
@NERDfirst Жыл бұрын
Hello and thank you for your comment! As mentioned in the video, this is the challenging part. There is no single method that will reliably generate such a function for you. Some frameworks for reasoning about it do exist and I'll link it here, but ultimately your own experience and pattern recognition skills are required here. Further reading: cs.stackexchange.com/questions/30543/what-is-the-intuition-behind-the-potential-function-in-amortized-analysis-of-som
@blacklight8932 Жыл бұрын
7:23 What exactly is the number of operations here? 63 < ? Isn't the total cost the number of operations?
@NERDfirst Жыл бұрын
Hello and thank you for your comment! The point is to think of this in the abstract! Whether the same algorithm runs for N=4 or N=1000000, the relationship holds. For that example, the total cost of expensive operations (ie. All the array expansions) is 63. There have been 32 insert operations on the array. Hence, the cost is always bounded by 2 × the number of insertion operations.
@anonInDE7 жыл бұрын
With the accountant's method... I don't get why you assigned $3 per operation.... I mean what's to stop me from assigning $10, or $20 per operation, or even infinity and then I could use that same argument to argue that any operation amortized costs O(1) only! Where did I get these $3 from? I can't seem to grasp that... Can anybody explain that to me please?
@NERDfirst7 жыл бұрын
Hello and thank you for your comment! The costs assigned are arbitrary, but there is a strategy to picking them. The general idea is that we want to _count_ the number of fundamental units of operation (which we usually assign as $1), and see how many of them take place on average "per step" over a data structure of size n. Of course you could give it $10 or $20, but: 1) In general, we are talking about worst case time complexity, so we want a tight bound. It's the same way saying bubble sort has a worst case time complexity of O(2^n) isn't _technically_ wrong (Big O notations only specify an upper bound), but saying this becomes meaningless because _tight_ upper bounds are more useful. 2) If the algorithm can't be amortized to O(1), using a large constant cost won't help you - You will get to a point where the $10 or even $100 or $1000 you assign won't be enough. Of course, infinity is another question altogether. If you use infinity the whole exercise becomes pointless because you'll never run out, so you can't do that.
@christopherweeks893 жыл бұрын
great video!
@NERDfirst3 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@chaochen5115 жыл бұрын
I like your shadow on the wall
@NERDfirst5 жыл бұрын
Shadow likes you too!
@amitmohanty26794 жыл бұрын
Thank you for the amazing explanation. Just a doubt In Aggregate analysis isn't the cost of an expensive operation is 4 when 3 items instead of 4 items. This is due to the new array creation point is when we try to insert 3 item to the dynamic array. Correct me if I am wrong.
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! It depends on when you want to expand the array. In the example shown, we expand the array when it becomes full as the result of an insertion operation. You can of course choose to do this earlier.
@amitmohanty26794 жыл бұрын
@@NERDfirst Thank you.
@moritzgoe2 жыл бұрын
Great Video! :)
@NERDfirst2 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@sadiahabib55067 жыл бұрын
Wow better than teachers there in university. I wonder about people who disliked 🤔🤔
@NERDfirst7 жыл бұрын
Hello and thank you very much for your comment! I wouldn't worry about dislikes, what's important is that the people who need my help get it :)
@aswing27064 жыл бұрын
Thank you brother
@NERDfirst4 жыл бұрын
You're welcome! Glad to be of help =)
@marcocaniglia30614 жыл бұрын
Awesome video, wish my boring professor just showed us your video in class instead of wasting our time for 1.5hrs lol
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Heh, it's not an easy topic to deliver on the go, so I can understand. Either way, glad to be of help =)
@EibeMandel7 жыл бұрын
Perfect, thanks
@NERDfirst7 жыл бұрын
You're welcome! Happy to be of help =)
@jakobskovsndergard79122 жыл бұрын
fantastic video: just a tiny comment. is the cost correct in the table with the aggregate stuff. I would expect the cost to be: 1,2,3,1,5,1,1,1,9,1,1,1,1,1,1,17……because we copy when we want to insert to a full table that has no more space, not when inserting to the last slot in the array.
@NERDfirst2 жыл бұрын
Hello and thank you for your comment! An interesting thought, but it works out all the same, because the work kicks in at comparable points in time - The total amount of work done is exactly equal. I would say both strategies are equivalent, though round powers of two are nicer to look at =)
@Samuel-wl4fw4 жыл бұрын
Great video
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Glad to be of help =)
@absence9443 Жыл бұрын
Quick n neat, do you have to guess the cost for accounting and function for the potential method?
@NERDfirst Жыл бұрын
Hello and thank you for your comment! I don't think you'll really ever need to blindly guess in the dark. If it helps, start with the aggregate method first to see a pattern. Of course, there's no single method that will always give you a perfect answer from the get go, so some experience and pattern recognition skills are required, but there are some frameworks for reasoning about this. Here's a pretty good writeup: cs.stackexchange.com/questions/30543/what-is-the-intuition-behind-the-potential-function-in-amortized-analysis-of-som
@absence9443 Жыл бұрын
@@NERDfirst thank thee :)
@mahwishch38837 жыл бұрын
excellent work..keep it up (Y)
@NERDfirst7 жыл бұрын
Thank you very much! Glad you liked the video =)
@gopikrishnan73802 жыл бұрын
Thank you sir.
@NERDfirst2 жыл бұрын
You're welcome! Happy to be of help =)
@milda12205 жыл бұрын
GOOD JOB!
@NERDfirst5 жыл бұрын
Thank you very much! Glad you liked the video =)
@johndambrosio74104 жыл бұрын
During the accounting method, what is the cost for creating the new, double in size, array?
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Intuitively I'd say _creating_ the array is O(1) since that just involves setting aside a contiguous block of RAM (assuming availability). It's the _shifting_ of items from the old array into the new that takes O(n).
@farruhhabibullaev53166 жыл бұрын
It is cool bro. Thank you
@NERDfirst6 жыл бұрын
You're welcome! Glad to be of help =)
@AkashVerma-sq8eq4 жыл бұрын
Even if the number of cheap operations are NEARLY (and not equal to n) n times, is it correct to say it's total cost is of order O(n)?
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! To greatly oversimplify, the Big O Notation just indicates the fastest growing component. So usually when we see c*n + a (where c and a are constant numbers), we'll just represent it as O(n). For more on this topic, you may want to check out my playlist on asymptotic notations: kzbin.info/aero/PLJse9iV6Reqh5B_w9koGyT7nlYm92iITk
@thepinkcodon5 жыл бұрын
I have a question, somebody please help! In the aggregate method, how exactly are there n number of operations? In this example, for the total cost in the aggregate method, it's a GP with sum = 2n-1. So, the total cost is of complexity O(n). But for calculating the average, why did you divide it by n? How is the number of operations = n? Also, what exactly do we mean by operations here?
@NERDfirst5 жыл бұрын
Hello and thank you for your comment! The number of operations is n because there have been n item insertions into the array. The most sensible definition of "operation" is one unit of work, as in, one thing you can do to said data structure. Clearly this will vary depending on what problem you're trying to analyze. However, generally speaking, if you're analyzing a series of steps and want to find out the amortized time complexity, then you'd want to divide by the individual steps that make up the series of operations.
@thepinkcodon5 жыл бұрын
@@NERDfirst Thank you for the explanation. :)
@thanglai48805 жыл бұрын
could you explain for me what is the mean of cost you use in aggregate method ? is it related to big o notation ? Again, many thanks for your videos.i really appreciate it
@NERDfirst5 жыл бұрын
Hello and thank you for your comment! Cost "leads" us towards coming up with a conclusion for Big O time complexity, though when we're discussing "cost", we're not quite there yet. Think of cost as a count of the number of steps, as in 1 unit of cost is equivalent to one step.
@parikshitrajpara57064 жыл бұрын
good work
@NERDfirst4 жыл бұрын
Hello and thank you for your comment! Glad to be of help =)