No video

Interval Scheduling Maximization (Proof w/ Exchange Argument)

  Рет қаралды 61,714

Back To Back SWE

Back To Back SWE

Күн бұрын

Code & Problem Statement @ backtobackswe....
Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe....
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓New Unseen Questions
🔎 Get All Solutions
Subscribe To Live Tech Offers: offerfeed.io
Join Our Coaching Service: backtobackswe....
In this video, we talk about the Interval Scheduling Maximization Problem. We look at the greedy solution as well as a proof via an exchange argument.

Пікірлер: 146
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
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
@maythecodesbewithyou29
@maythecodesbewithyou29 4 жыл бұрын
great video man
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@amitbhogal7406
@amitbhogal7406 2 жыл бұрын
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!
@sankalparora9261
@sankalparora9261 4 жыл бұрын
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.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye - lol nice
@spectermakoto9029
@spectermakoto9029 4 жыл бұрын
This channel is a goldmine Just really exceptional stuff clear, concise and fun to watch
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@MMOlocation
@MMOlocation 4 жыл бұрын
Your channel and leetcode got me an internship at facebook. Thank you dude, keep it up!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Excellent, have fun there!
@krishnnasarrdah3534
@krishnnasarrdah3534 4 жыл бұрын
fr? how did you apply? can you help me out?
@maythecodesbewithyou29
@maythecodesbewithyou29 4 жыл бұрын
congrats
@hsinyang1796
@hsinyang1796 3 жыл бұрын
congrats!
@crazytourist6619
@crazytourist6619 14 күн бұрын
I just fell in love with this explanation !!!
@peterren5409
@peterren5409 2 жыл бұрын
This man has helped me with my algo class more than anyone else
@amanial-khalifa5299
@amanial-khalifa5299 2 жыл бұрын
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!
@johnleonardo
@johnleonardo 4 жыл бұрын
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!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha thanks, and nah, it is steady growth so slowly but surely
@ashelytang2592
@ashelytang2592 4 жыл бұрын
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!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Nice
@Messirobben047
@Messirobben047 3 жыл бұрын
Best problem-solving channel on KZfaq. Brilliant stuff!
@maripaz5650
@maripaz5650 3 жыл бұрын
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.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
great
@acspd7
@acspd7 4 жыл бұрын
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.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
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
@MuffinLucas
@MuffinLucas 3 жыл бұрын
You're such a talented teacher, than you for these wonderful videos!
@brandenhernandez7772
@brandenhernandez7772 3 жыл бұрын
been watching all your videos for my final and man you explain 16 weeks of school better in a 20 min video.
@jpfsilva
@jpfsilva 3 жыл бұрын
These videos of him are amazing! He explains perfectly well and understandable. Thanks for that!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
thanks
@dotanoob466
@dotanoob466 3 жыл бұрын
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!
@zhangxuewei7554
@zhangxuewei7554 2 жыл бұрын
dude, you are born to be a teacher!
@Nima-Salami
@Nima-Salami 2 жыл бұрын
Duuuude! The best explanation I've found on Exchange Argument! God bless you!
@devinshaw8558
@devinshaw8558 4 ай бұрын
Very hard to build an intuition for this, but this video is closest I have seen.
@shizibaozi
@shizibaozi 10 ай бұрын
such a great and clear explain, even though I am poor at English can understand.
@BackToBackSWE
@BackToBackSWE 10 ай бұрын
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
@Dryicicles
@Dryicicles 3 жыл бұрын
Jesus Christ what an incredibly fresh cut
@leakyshoes8297
@leakyshoes8297 Жыл бұрын
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!
@Amy-tw3zh
@Amy-tw3zh 4 жыл бұрын
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.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@nguyentuan1990
@nguyentuan1990 3 жыл бұрын
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)
@tofahub
@tofahub 4 жыл бұрын
You are an algorithmist. Such an inspiration!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Lol, no, I'm just an average dude who recorded a lot of videos
@user-rf4vc7mt4d
@user-rf4vc7mt4d 4 жыл бұрын
I wish you were my professor. This is sooo helpful
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure
@srishtijain1092
@srishtijain1092 3 жыл бұрын
Amazing video! Thanks for the wonderful content always!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure
@sitanshushukla1820
@sitanshushukla1820 4 жыл бұрын
Your explanations are the best!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@weizhao8214
@weizhao8214 4 жыл бұрын
I really should have watch this video before my midterm
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey
@EliseGreen-tz2qe
@EliseGreen-tz2qe 10 ай бұрын
Very clear explanation!
@BackToBackSWE
@BackToBackSWE 10 ай бұрын
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
@kumarutkarsh4016
@kumarutkarsh4016 4 жыл бұрын
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?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
im not sure I barley remember this video im sorry
@kumarutkarsh4016
@kumarutkarsh4016 4 жыл бұрын
@@BackToBackSWE Oh, no issues.
@Leo-tz7lp
@Leo-tz7lp 3 жыл бұрын
MAN was this video well made, thank you.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
Glad you enjoyed it!
@ahonhuman3717
@ahonhuman3717 8 ай бұрын
Incredible video! Thank you!
@BackToBackSWE
@BackToBackSWE 8 ай бұрын
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
@anonymoussloth6687
@anonymoussloth6687 3 жыл бұрын
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
@shanness237
@shanness237 4 жыл бұрын
Crystal clear!!!! Thank you!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@andywang4189
@andywang4189 4 жыл бұрын
Thanks, this is best explanation of the proof
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@OrangePotatoLeo
@OrangePotatoLeo Жыл бұрын
Great job explaining!
@anhduy7367
@anhduy7367 4 жыл бұрын
This helps me a lot. Thank you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great
@ananydwivedi5853
@ananydwivedi5853 2 жыл бұрын
Very good explanation, thank you!
@nawendusingh2858
@nawendusingh2858 4 жыл бұрын
watching this tonight coz i have finals tomorrow.thanks for such a great explanation. Have u done interval partitioning as well?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
na
@TomChan-nn7mu
@TomChan-nn7mu 5 ай бұрын
you save my life
@adods4058
@adods4058 4 жыл бұрын
Good job. Well explained
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@adityasrivastava8790
@adityasrivastava8790 3 жыл бұрын
Hey John Legend! Keep up the Good work my man!!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
ok
@adityasrivastava8790
@adityasrivastava8790 3 жыл бұрын
@@BackToBackSWE "ok", *seriously?!
@xinyucao5550
@xinyucao5550 4 жыл бұрын
Great explanation!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@abdelrhmangamal3018
@abdelrhmangamal3018 2 жыл бұрын
شكرا صاح! عمال ساعة بحاول افهم بس انت راجل صح الصح وفهمت خلاص الحمد لله.
@alexandra4629
@alexandra4629 4 ай бұрын
Thank you so much.
@shahainmanujith2109
@shahainmanujith2109 2 ай бұрын
Nice explanation :)
@paiqu3933
@paiqu3933 4 жыл бұрын
Thank you so much for the video!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@hiteshnagothu887
@hiteshnagothu887 4 жыл бұрын
Thank you so much!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure - thanks for watching
@BeatYourYesterday
@BeatYourYesterday 2 жыл бұрын
great work
@squadbustersgamings
@squadbustersgamings 4 жыл бұрын
Nice video, could you do a video on Weighted Interval Scheduling?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Yes, I just don't have the time though. If you have . aquestion I can answer it here
@squadbustersgamings
@squadbustersgamings 4 жыл бұрын
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 :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@squadbustersgamings ye
@top-list6450
@top-list6450 4 жыл бұрын
Thanks for these amazing videos . could you also add the question link, so that we can try
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I don't have a link for it
@malikfahadsarwar2281
@malikfahadsarwar2281 2 жыл бұрын
how you can say that fgk
@ahm_adash_i6723
@ahm_adash_i6723 3 жыл бұрын
thank you sir
@prachurjyakashyap2029
@prachurjyakashyap2029 4 жыл бұрын
You got a subscriber
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I'm blessed
@susmitjaiswal136
@susmitjaiswal136 Жыл бұрын
aaammaazzinggg...got it perfectly
@user-wd4xn2it4e
@user-wd4xn2it4e 2 жыл бұрын
great explanation thank you :)
@1234rajan1234
@1234rajan1234 4 жыл бұрын
thanks i get it now bro
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@ANGELINK999
@ANGELINK999 4 жыл бұрын
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!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
The notation & abstract academic nature of proofs confuse at first. Most take a bit to sink in.
@vasiliinikonov6477
@vasiliinikonov6477 4 жыл бұрын
He spoke of the code in the description, but I cannot find it
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
The repository is deprecated - we only maintain backtobackswe.com.
@sumukhbhat1641
@sumukhbhat1641 2 жыл бұрын
Why sort by finish time and not by start time? I sorted by start time and it cost me a coding round :(
@DheemanSaha
@DheemanSaha 3 жыл бұрын
Well I was not cleared how you made sure your greedy solution is the optimal solution. Is it possible to share more information?
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
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
@praveenchouhan6388
@praveenchouhan6388 3 жыл бұрын
so this looks like a combo of greedy and dynamic programming right???
@dotanoob466
@dotanoob466 3 жыл бұрын
Subscribed.
@anonymoussloth6687
@anonymoussloth6687 3 жыл бұрын
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?
@tommieb8623
@tommieb8623 4 жыл бұрын
Is there also a greedy method for maximization of the intervals length instead of the amount of intervals?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
not sure
@JustixLoL
@JustixLoL 4 жыл бұрын
I guess in this case you need to exchange previously chosen interval with current if it is smaller then current and continue
@ankithreddyadudodla7673
@ankithreddyadudodla7673 4 жыл бұрын
cool and nice
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks lol
@arpithparikh
@arpithparikh 4 жыл бұрын
can we say Greedy Exchange is the most efficient solution?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
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.
@benzeltser9851
@benzeltser9851 2 жыл бұрын
I need to rob my University, take all what I've paid them, and hand it all to you
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Hahaa
@MathAfta
@MathAfta 7 ай бұрын
Hero !
@InfernTech
@InfernTech Жыл бұрын
so good
@yoshi4980
@yoshi4980 4 жыл бұрын
too late :'(
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha, indeed
@yoonchaena671
@yoonchaena671 3 жыл бұрын
you save me thanks
@poojasadevra3893
@poojasadevra3893 4 жыл бұрын
I think I kinda got what optimal substructure means here ..
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@alantao6895
@alantao6895 4 жыл бұрын
where the heck is the code? 🤔
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
repository is deprecated, we do not maintain it but it is still on my github
@nikmitsioris9809
@nikmitsioris9809 2 жыл бұрын
godlike!!
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Thank you, glad you liked it 😀 Do check out backtobackswe.com/platform/content and please recommend us to your family and friends 😀
@maxbarahona9675
@maxbarahona9675 4 жыл бұрын
What is your leetcode username?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
leetcode.com/bephrem/
@souravprajapati4578
@souravprajapati4578 4 жыл бұрын
bro the implementation ? the code?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
The repository is deprecated - we only maintain backtobackswe.com now.
@maheshg3619
@maheshg3619 4 жыл бұрын
waiting for your video
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
wassup
@arunm619
@arunm619 4 жыл бұрын
Burst balloons dp problem please post
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@arunm619 yessir
@supamdeepbains5172
@supamdeepbains5172 4 жыл бұрын
sup bro?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hi
@aidan618
@aidan618 2 жыл бұрын
Great explanation but why does he explain this like a tech bro hahaha
@praveenchouhan6388
@praveenchouhan6388 4 жыл бұрын
unclear!!!!!!!!!!!!!!!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok!
@ahsanulameensabit
@ahsanulameensabit 4 жыл бұрын
Good explanation :|
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@pranavsingh9284
@pranavsingh9284 3 жыл бұрын
very much thanks sir
Interval Partitioning ( Greedy Algorithm ) - Algorithms
14:37
MisterCode
Рет қаралды 47 М.
WHO CAN RUN FASTER?
00:23
Zhong
Рет қаралды 46 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 11 МЛН
Greedy Exchange Arguments (Algorithms 09)
25:58
Professor Bryce
Рет қаралды 10 М.
Network Flows: Max-Flow Min-Cut Theorem (& Ford-Fulkerson Algorithm)
21:56
The Change Making Problem - Fewest Coins To Make Change Dynamic Programming
23:12
Algorithms Lecture 16: Greedy Algorithms, Proofs of Correctness
20:11
Ghassan Shobaki Computer Science Lectures
Рет қаралды 30 М.
Greedy Algorithms for Time-Slot Interval Optimization
11:51
Course Grinder
Рет қаралды 51 М.
Inequality Mathematical Induction Proof: 2^n greater than n^2
9:20
The Math Sorcerer
Рет қаралды 171 М.
WHO CAN RUN FASTER?
00:23
Zhong
Рет қаралды 46 МЛН