Table of Contents: Introduction 0:00 - 1:22 Greedy Algorithm Walkthrough 1:22 - 5:14 What We Want To Prove 5:14 - 7:03 Exchange Arguments 7:03 - 7:33 The Proof 7:33 - 11:30 Trying To Exchange 11:30 - 16:20 Finishing The Argument 16:20 - 19:24 Conclusion 19:24 - 20:17
@maythecodesbewithyou294 жыл бұрын
great video man
@BackToBackSWE4 жыл бұрын
thanks
@amitbhogal74063 жыл бұрын
This is an award-winning explanation if one considers the patience, thoughtfulness and elocution with which it has been done. God bless your continued efforts in education!
@sankalparora92614 жыл бұрын
I have never seen so in-depth understanding of Interval Scheduling ANYWHERE! Keep killing it!!! THANKS, A LOT! "By the very nature we are doing something, there can be no conflict" hit me the most.
@BackToBackSWE4 жыл бұрын
ye - lol nice
@spectermakoto90295 жыл бұрын
This channel is a goldmine Just really exceptional stuff clear, concise and fun to watch
@BackToBackSWE5 жыл бұрын
thx
@MMOlocation5 жыл бұрын
Your channel and leetcode got me an internship at facebook. Thank you dude, keep it up!
@BackToBackSWE5 жыл бұрын
Excellent, have fun there!
@krishnnasarrdah35344 жыл бұрын
fr? how did you apply? can you help me out?
@maythecodesbewithyou294 жыл бұрын
congrats
@hsinyang17964 жыл бұрын
congrats!
@amanial-khalifa52992 жыл бұрын
Can you believe that I have attended two 2 hour lectures about greedy algorithm and I have just understood it in this 20 minutes video! Thank you!
@peterren54092 жыл бұрын
This man has helped me with my algo class more than anyone else
@ashelytang25924 жыл бұрын
I have an Algorithms Midterm tomorrow and I found this video to be super helpful! I could understand everything you were saying! Simple and straightforward explanations are the best!!! Thank you for this!
@BackToBackSWE4 жыл бұрын
Nice
@acspd75 жыл бұрын
Just wanted to let you know you are God's gift to mankind. I can really tell you have a genuine passion to teach and help others. Not some scumbag (which there are many, unfortunately in this industry) looking to cash in on exploit tech job seekers because the market is fiercely competitive these days. And even if you did end up charging for your course, I'd still pay for it because you come from a good place. Great work.
@BackToBackSWE5 жыл бұрын
Haha, um, I mean I am morally dubious certain days, mostly not. And yeah lol, I don't really think about anything I'm doing...I'm just doing
@Messirobben0473 жыл бұрын
Best problem-solving channel on KZbin. Brilliant stuff!
@dotanoob4663 жыл бұрын
Excellent! As a person with a background in math who now works as a software dev who’s looking for a new job, this was great. Underneath it all, at its fundamental level, i think this a proof by induction. Very well explained!
@brandenhernandez77724 жыл бұрын
been watching all your videos for my final and man you explain 16 weeks of school better in a 20 min video.
@crazytourist66193 ай бұрын
I just fell in love with this explanation !!!
@maripaz56504 жыл бұрын
binge-watching your videos before a final round interview. thank you very much! your videos have helped me get so much further this recruiting season.
@BackToBackSWE4 жыл бұрын
great
@johnleonardo5 жыл бұрын
dude, your explanations are out of this world! you’re helping me with interview prep so much. thank you & subbed, liked. this channel is en route to blowing up!
@BackToBackSWE5 жыл бұрын
haha thanks, and nah, it is steady growth so slowly but surely
@leakyshoes82972 жыл бұрын
Love this. Wish it would show a written proof with induction. Only saying this because there was a lot of talking, but putting this into a written proof is a bit mind bending. However, absolutely thumbs up and subscribed!
@zhangxuewei75542 жыл бұрын
dude, you are born to be a teacher!
@MuffinLucas3 жыл бұрын
You're such a talented teacher, than you for these wonderful videos!
@jpfsilva4 жыл бұрын
These videos of him are amazing! He explains perfectly well and understandable. Thanks for that!
@BackToBackSWE4 жыл бұрын
thanks
@Nima-Salami2 жыл бұрын
Duuuude! The best explanation I've found on Exchange Argument! God bless you!
@Amy-tw3zh4 жыл бұрын
This makes good sense. I had to picture in my head the diagram or examples as you explained all the WHY's, to convince myself that it's always true. And indeed it is. It's hard to think about application of this to other algorithms though.
@BackToBackSWE4 жыл бұрын
ye
@Dryicicles3 жыл бұрын
Jesus Christ what an incredibly fresh cut
@tofahub4 жыл бұрын
You are an algorithmist. Such an inspiration!
@BackToBackSWE4 жыл бұрын
Lol, no, I'm just an average dude who recorded a lot of videos
@devinshaw85587 ай бұрын
Very hard to build an intuition for this, but this video is closest I have seen.
@weizhao82145 жыл бұрын
I really should have watch this video before my midterm
@BackToBackSWE5 жыл бұрын
hey
@kumarutkarsh40164 жыл бұрын
Consider a variant of this question. We are supposed to find intervals giving the max cardinality as before. But the added constraint is that in the case of two solutions having the same cardinality, we need to pick the solution where the length of time covered by all the intervals is lowest. What modifications (if any) to the current algo would be required?
@BackToBackSWE4 жыл бұрын
im not sure I barley remember this video im sorry
@kumarutkarsh40164 жыл бұрын
@@BackToBackSWE Oh, no issues.
@srishtijain10924 жыл бұрын
Amazing video! Thanks for the wonderful content always!
@BackToBackSWE4 жыл бұрын
sure
@user-rf4vc7mt4d4 жыл бұрын
I wish you were my professor. This is sooo helpful
@BackToBackSWE4 жыл бұрын
sure
@nguyentuan19903 жыл бұрын
I dont understand, so everything is the same from G to O until k-1 but k is where everything diverge ? how can you say that the finishing time fo G(k)
@shizibaozi Жыл бұрын
such a great and clear explain, even though I am poor at English can understand.
@BackToBackSWE Жыл бұрын
Happy Halloween 🎃 Thank you for your kind words, shizibaozi! What languages do you speak? You get some extraaa treats for the hardwork - 50% Off our exclusive lifetime membership use the code SPOOKY50 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=SPOOKY50
@Leo-tz7lp3 жыл бұрын
MAN was this video well made, thank you.
@BackToBackSWE3 жыл бұрын
Glad you enjoyed it!
@anonymoussloth66873 жыл бұрын
i had a similar problem, but i cant find a solution to this anywhere. in fact, i cant even find the problem anywhere (i originally saw this problem on my university test). the problem is, u r given n jobs with start and finish times, and u have to find the minimum number of processors that can finish all jobs. a processor can only do disjoint jobs (jobs that don't overlap). Sample test case: There are 5 jobs (with start and end time given respectively): 1 11 2 3 3 6 4 6 10 13 The answer is you need a min of 3 processors to complete all the jobs. processor 1: 1-11 processor 2: 2-3 4-6 10-13 processor 3: 3-6
@adityasrivastava87904 жыл бұрын
Hey John Legend! Keep up the Good work my man!!
@BackToBackSWE4 жыл бұрын
ok
@adityasrivastava87904 жыл бұрын
@@BackToBackSWE "ok", *seriously?!
@sitanshushukla18204 жыл бұрын
Your explanations are the best!!!
@BackToBackSWE4 жыл бұрын
sure
@nawendusingh28585 жыл бұрын
watching this tonight coz i have finals tomorrow.thanks for such a great explanation. Have u done interval partitioning as well?
@BackToBackSWE5 жыл бұрын
na
@andywang41894 жыл бұрын
Thanks, this is best explanation of the proof
@BackToBackSWE4 жыл бұрын
sure
@OrangePotatoLeo2 жыл бұрын
Great job explaining!
@ananydwivedi58532 жыл бұрын
Very good explanation, thank you!
@benzeltser98512 жыл бұрын
I need to rob my University, take all what I've paid them, and hand it all to you
@BackToBackSWE2 жыл бұрын
Hahaa
@DheemanSaha4 жыл бұрын
Well I was not cleared how you made sure your greedy solution is the optimal solution. Is it possible to share more information?
@BackToBackSWE4 жыл бұрын
I forgot the contents of this video but loosely remember that it had to do with an exchange argument. Fast replying to comments cant address
@top-list64505 жыл бұрын
Thanks for these amazing videos . could you also add the question link, so that we can try
@BackToBackSWE5 жыл бұрын
I don't have a link for it
@shanness2374 жыл бұрын
Crystal clear!!!! Thank you!
@BackToBackSWE4 жыл бұрын
nice
@anhduy73674 жыл бұрын
This helps me a lot. Thank you
@BackToBackSWE4 жыл бұрын
great
@praveenchouhan63884 жыл бұрын
so this looks like a combo of greedy and dynamic programming right???
@ahonhuman371711 ай бұрын
Incredible video! Thank you!
@BackToBackSWE11 ай бұрын
Happy Holidays 🎉 Thank you for your kind words, ahonhuman! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40
@adods40584 жыл бұрын
Good job. Well explained
@BackToBackSWE4 жыл бұрын
thanks
@EliseGreen-tz2qe Жыл бұрын
Very clear explanation!
@BackToBackSWE Жыл бұрын
Happy Halloween 🎃 Thank you for your kind words, EliseGreen! Let us know other topics we could cover! We'd love to offer you 50% Off our exclusive lifetime membership use the code SPOOKY50 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=SPOOKY50
@arpithparikh5 жыл бұрын
can we say Greedy Exchange is the most efficient solution?
@BackToBackSWE5 жыл бұрын
I'm not sure? Efficient asymptotically or in terms of real elapsed time? If the former it'd have to be, because linear time is the lower bound, we have to inspect all intervals.
@TomChan-nn7mu8 ай бұрын
you save my life
@squadbustersgamings5 жыл бұрын
Nice video, could you do a video on Weighted Interval Scheduling?
@BackToBackSWE5 жыл бұрын
Yes, I just don't have the time though. If you have . aquestion I can answer it here
@squadbustersgamings5 жыл бұрын
No question! Your explanation is really good btw! I was just having a hard time understanding weighted interval scheduling and hope you can do the video on this when you are free :)
I am a little confused. Does an exchange mean that ur are sawing 2 events? Or are u inserting one and still keeping the other? For ex, gk and bk, did u put gk in optimal set and still keep bk after it or did u replace bk by gk?
@vasiliinikonov64774 жыл бұрын
He spoke of the code in the description, but I cannot find it
@BackToBackSWE4 жыл бұрын
The repository is deprecated - we only maintain backtobackswe.com.
@shahainmanujith21095 ай бұрын
Nice explanation :)
@אסףוטרמן2 жыл бұрын
great explanation thank you :)
@tommieb86234 жыл бұрын
Is there also a greedy method for maximization of the intervals length instead of the amount of intervals?
@BackToBackSWE4 жыл бұрын
not sure
@JustixLoL4 жыл бұрын
I guess in this case you need to exchange previously chosen interval with current if it is smaller then current and continue
@alexandra46297 ай бұрын
Thank you so much.
@prachurjyakashyap20294 жыл бұрын
You got a subscriber
@BackToBackSWE4 жыл бұрын
I'm blessed
@hiteshnagothu8874 жыл бұрын
Thank you so much!!!
@BackToBackSWE4 жыл бұрын
sure - thanks for watching
@1234rajan12345 жыл бұрын
thanks i get it now bro
@BackToBackSWE5 жыл бұрын
nice
@BeatYourYesterday3 жыл бұрын
great work
@susmitjaiswal1362 жыл бұрын
aaammaazzinggg...got it perfectly
@poojasadevra38935 жыл бұрын
I think I kinda got what optimal substructure means here ..
@BackToBackSWE5 жыл бұрын
nice
@yoshi49805 жыл бұрын
too late :'(
@BackToBackSWE5 жыл бұрын
haha, indeed
@ANGELINK9995 жыл бұрын
I understood the first part (the algorithm explanation) but not the one where you compare the Optimal vs the Greedy one. I guess I need to see it more times. Haha. Anyways, awesome work!
@BackToBackSWE5 жыл бұрын
The notation & abstract academic nature of proofs confuse at first. Most take a bit to sink in.
@sumukhbhat16412 жыл бұрын
Why sort by finish time and not by start time? I sorted by start time and it cost me a coding round :(
@ahm_adash_i67233 жыл бұрын
thank you sir
@malikfahadsarwar22813 жыл бұрын
how you can say that fgk
@dotanoob4663 жыл бұрын
Subscribed.
@yoonchaena6713 жыл бұрын
you save me thanks
@pranavsingh92844 жыл бұрын
very much thanks sir
@alantao68954 жыл бұрын
where the heck is the code? 🤔
@BackToBackSWE4 жыл бұрын
repository is deprecated, we do not maintain it but it is still on my github
@MathAfta11 ай бұрын
Hero !
@InfernTech2 жыл бұрын
so good
@ankithreddyadudodla76734 жыл бұрын
cool and nice
@BackToBackSWE4 жыл бұрын
thanks lol
@maxbarahona96755 жыл бұрын
What is your leetcode username?
@BackToBackSWE5 жыл бұрын
leetcode.com/bephrem/
@nikmitsioris98092 жыл бұрын
godlike!!
@BackToBackSWE2 жыл бұрын
Thank you, glad you liked it 😀 Do check out backtobackswe.com/platform/content and please recommend us to your family and friends 😀
@souravprajapati45784 жыл бұрын
bro the implementation ? the code?
@BackToBackSWE4 жыл бұрын
The repository is deprecated - we only maintain backtobackswe.com now.
@maheshg36195 жыл бұрын
waiting for your video
@BackToBackSWE5 жыл бұрын
wassup
@arunm6195 жыл бұрын
Burst balloons dp problem please post
@BackToBackSWE5 жыл бұрын
@@arunm619 yessir
@supamdeepbains51724 жыл бұрын
sup bro?
@BackToBackSWE4 жыл бұрын
hi
@furyzlm78532 ай бұрын
W
@aidan6183 жыл бұрын
Great explanation but why does he explain this like a tech bro hahaha