Binary Search | BS-18. Allocate Books or Book Allocation | Hard Binary Search

Sdílet
Vložit
  • čas přidán 9. 09. 2024
  • Please watch our new video on the same topic: • BS-18. Allocate Books ...
    Check our Website:
    Notes: • BS-18. Allocate Books ...

Komentáře • 681

  • @takeUforward
    @takeUforward  Před rokem +4

    Please watch our new video on the same topic: czcams.com/video/Z0hwjftStI4/video.html

  • @srikanthreddy9103
    @srikanthreddy9103 Před rokem +19

    At 9:05 the low should be the max element of the array. As we cannot divide single book to two persons, the max pages book can be allocated to single person only. So we cannot have the answer less than the maximum of the array. I hope it makes sense :)

  • @mohdhasnain3812
    @mohdhasnain3812 Před 3 lety +112

    Brother honestly saying i haven't seen such a kind of teaching anywhere else.... your expressions along with your hand actions i was able to understand each and every step.. Thanks a lot🔥

    • @arjunyadav-kt5jr
      @arjunyadav-kt5jr Před rokem

      exactly my point i had seen his vlogs but to study i came here for the first time, it was so fun understanding the concept

  • @samkr200
    @samkr200 Před 3 lety +165

    At 23:59, there is a small problem, It's correct in the GitHub code though. It should be pages = arr[i], instead of pages += arr[i];

  • @SahilSharma-vl9rk
    @SahilSharma-vl9rk Před 3 lety +73

    Now it really feels like we are sitting on our chair and our teacher is teching is on board like in the school
    #Nostalgia

  • @codelite700
    @codelite700 Před rokem +2

    How could someone possibly think of such an approach?
    Forget 40 mins interview, It would've taken me forever to build such logic.
    Human mind is truly amazing ❤

  • @ankitkumaryadav562
    @ankitkumaryadav562 Před 3 lety +56

    at 24:33 Correction else condition ke andar pages = arr[i] hoga mistake se pages += arr[i] leka ja chuka hai

    • @tanmaysinghal8370
      @tanmaysinghal8370 Před 3 lety +2

      Page to plus hi honge bhai.... Agar same bande jo rha h to

    • @rohitshirur7640
      @rohitshirur7640 Před 2 lety +1

      @@tanmaysinghal8370 No, brother it will not work when condition is true then new book pages is allotted to that new student and that time we have to make it equals not addition or else the condition will always be true
      try this input and check
      pages = [250 74 159 181 23 45 129 174]
      students = 6

    • @rohitshirur7640
      @rohitshirur7640 Před 2 lety

      Yes, Brother

    • @tejas7379
      @tejas7379 Před 2 lety +6

      Ig it should be pages = arr[i] in if condition!!
      As soon as we increase student, we should reset pages

    • @shikharmishra5700
      @shikharmishra5700 Před 2 lety +1

      abbe chutiye else mein nhi but 2nd if mai pages=arr[i] hoga

  • @ankitkumarmahato4318
    @ankitkumarmahato4318 Před 3 lety +10

    I have a question. In the isPossible function the last line is
    if(allocatedstu>k)
    return false;
    return true;
    this means it will return true even if allocatedstudent is less than k(might be possible) which is not allowed right, because each student should be allocated at least one book.

    • @architchanana7866
      @architchanana7866 Před rokem +1

      same doubt ... If you have the solution why he did, Can you please tell me.

    • @anuragtiwari9793
      @anuragtiwari9793 Před rokem

      I have same doubt. Can someone pls explain??

    • @kunalrastogi6530
      @kunalrastogi6530 Před rokem

      No one can explain this , even striver bhaiya , that's why he ignore this comment.

  • @cenacr007
    @cenacr007 Před 2 lety +10

    such energy at 3 in the morning, we students are blessed to have people like you.

  • @the_humble_lazy
    @the_humble_lazy Před 3 lety +21

    Bro paused at 0:49 to tell u that u look very cool while explaining on the white board........the vibe is so awsm...... honestly speaking

  • @kshittizbhardwaj417
    @kshittizbhardwaj417 Před 3 lety +3

    I have a doubt. I'll be glad if anyone could help. Why are we returning true when allocated students

  • @takeUforward
    @takeUforward  Před 3 lety +67

    Please drop a small feedback on this white board idea of teaching.
    Small typo at end, it will be pages=a[i]
    Follow me at Instagram for all updates: instagram.com/striver_79/​

  • @arnabchakraborty246
    @arnabchakraborty246 Před 3 lety +31

    Bhaiya great video , very crystal clear concept you discussed, and this white board adds 100X more value to us

  • @marvel438
    @marvel438 Před 3 lety +15

    Amazing explanation like always but let me clarify time complexity analysis
    Let N = Number of Books
    arr[i] = Number of pages in ith book
    Binary Search Search Space = Low = minimum of arr[i] High = Sum of arr[i] (i -> 0 - N)
    For every search space mid-value we check allocationPossible (O(N) Can be optimised to O(1) with Prefix Sum
    TimeComplexity = O(N * Log(sum of arr - low))
    The the value inside log is the search space. So Log(N) is very wrong.
    Please correct me if I am wrong.
    Thank you

  • @yashbhange1517
    @yashbhange1517 Před 3 lety +26

    In IsPossible function ,in If statement , instead of pages+=arr[i] it should be pages=arr[i]

    • @takeUforward
      @takeUforward  Před 3 lety +9

      Yes mentioned in description as well as pinned comment. Thankyou.

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr Před 3 lety

      Can there be case where all the students are not allocated at least 1 book for a value of mid ???

    • @dutt_2302
      @dutt_2302 Před 3 lety

      @@SudhanshuKumar-lp1nr hello bro
      int isAllocated(vector& A,int num,int k){
      int count=1,sum=0,flag=0;
      for(int i=0;ik) return 2;
      return 1;
      }
      int Solution::books(vector &A, int B) {
      sort(A.begin(),A.end());
      int sum=0;
      for(int i=0;i

    • @jaisamtani303
      @jaisamtani303 Před 3 lety

      @@dutt_2302 bro no where in the video it was mentioned to SORT the array, why are you sorting it? Also why are returning 0/1/2 from your helper function.. return true/false and make it simple

  • @nithinshukla4679
    @nithinshukla4679 Před 3 lety +7

    wow there is literally no one who can explain such a complex problem so easily like you bro. your confidence in explaining it made it very clear. thank you

  • @HallaBhalla
    @HallaBhalla Před 3 lety +61

    A slight optimization is that the range lies between Max(arr) - Sum(arr), instead of Min(arr) - Sum(arr)

    • @takeUforward
      @takeUforward  Před 3 lety +20

      Yes we can do this.. thanks

    • @sandeepnallala48
      @sandeepnallala48 Před 3 lety +6

      yes bro , we can do this and we can skip the condition at beginning in the for loop because its guaranteed that
      our barrier will always be >= max Of the array, so all array elements individually can fit in the barrier 💛

    • @chandankumarshaw216
      @chandankumarshaw216 Před 3 lety

      how this possible, because we have to find the minimum no of pages....if we assume that there is only one student then he will get the min from the array and that's the answer

    • @sandeepnallala48
      @sandeepnallala48 Před 3 lety +2

      @@chandankumarshaw216 we need to find the maximums in all possible allocations, and see which max is actually minimum.. if only ine student then we will allocate all books to him.
      And if there are n Students where n is array size, each student we wil give one book. In each case, one of the student will get tha maxm pages book, and in all the psbl cases , the minimum psbl maximum is only that particular max..
      Dry run with some exmples.
      Crct me striver if iam wrong...

    • @chandankumarshaw216
      @chandankumarshaw216 Před 3 lety

      @@sandeepnallala48 okk thanks

  • @ketan_sahu
    @ketan_sahu Před 3 lety +1

    No article ever gave me this clear intuition for implementing binary search in an unsorted array. AMAZING!!

  • @scsknowledge4886
    @scsknowledge4886 Před rokem +2

    I think there is one one edge case added into the main method which is - If(number_of_Students > A.length) return -1;

  • @swatinawange5390
    @swatinawange5390 Před 3 lety +22

    This is amazing and a favorable methodology for learning.❤️💯💯

  • @PramodKumar-sz3od
    @PramodKumar-sz3od Před rokem +1

    The initial left limit of the search space should be 90 instead of 12. Which is the value max value present in the array.

  • @lovleshbhatt7797
    @lovleshbhatt7797 Před rokem +1

    I would believe the minimumValue should be the maximum of (arr[I]) , For example -> A = [5, 17, 100, 11]B = 4
    here low=100, and high=SumofArr[I].

  • @radhe1335
    @radhe1335 Před 3 lety +15

    Energy & explanation 😍🔥

  • @HarishSumant
    @HarishSumant Před rokem

    at 9:13, when deciding the minimum range, I think it should be the maximum of the given books array instead of the minimum from the array.
    when students and number of books are equal, the answer will be the maximum among the pages of the book and not the minimum one.

  • @Shubham-wm9oj
    @Shubham-wm9oj Před 3 lety +22

    Thanks for the genuine efforts Bhaiya !! I have watched your all the videos and learnt a lot from your sde series, your graph series is like a gem !
    bhaiya according to me.... teaching on pad is much more easier and effective 😅!!
    all the best bhaiya

    • @takeUforward
      @takeUforward  Před 3 lety +18

      Yes easier but usually in pad, i cannot show hand expressions, which in turn makes it very tough to communicate my thought.

    • @shivamkapil8116
      @shivamkapil8116 Před 3 lety

      @@takeUforward bhyaiya please make more videos on algorithms whenever u get time❣️❣️..it's really helpful

  • @krishnasinghal14
    @krishnasinghal14 Před 9 měsíci +1

    9:00 - the low should be the max element of the array. the max pages book can be allocated to single person only. So we cannot have the answer less than the maximum of the array.

  • @arnabdutta4662
    @arnabdutta4662 Před 2 lety +1

    Initially we can assign low = max(of the array elements) and high = sum(of all the array elements)
    Because it will be the minimum of maximum allotted pages.
    And I have one more doubt isn't the time complexity of the binary search - Log(sum_of_all_elements - min_element) or Log(sum_of_all_elements - max_element) ??

  • @itz_me_imraan02
    @itz_me_imraan02 Před 3 lety +89

    Want a tree series as well🙏

  • @sujalmishra352
    @sujalmishra352 Před 2 měsíci

    Amazing explanation bhaiya💯

  • @ayeshasolanki5386
    @ayeshasolanki5386 Před 2 lety +4

    Words won't suffice for the way of teaching you provide!!!! ❤

    • @sachinpathak3084
      @sachinpathak3084 Před 2 lety

      @Ayesha tell me one thing the time complexity of binary search is wrong in the video since the search space is not N but its M = (Sum(arr)-Max(arr)+1)

  • @ranasauravsingh
    @ranasauravsingh Před 2 lety +1

    UNDERSTOOD.... !!!
    Long life to the LEGEND.... :)

  • @iamparitosh
    @iamparitosh Před 3 lety +1

    The answer lies in between 90 -203 I think ie the low will be the maximum in array but anyways that doesn't make any significant TC difference

  • @prithvichetty15
    @prithvichetty15 Před 3 lety +1

    Best Explaination Whiteboard se concept aur clear hogaya waiting for your complete sde sheet to complete. ❤👌👍

  • @ShahidHussain-dh3pg
    @ShahidHussain-dh3pg Před 9 měsíci

    Respect for Hard work you are doing.

  • @roxxyyroy3404
    @roxxyyroy3404 Před 3 lety +5

    Yes this way of teaching topoc is great,more visualization ,more presentable and better presence .
    great approach. Continue with that.
    Just one thing to point out- video editing can be better .

  • @SohilLadhani
    @SohilLadhani Před 2 lety +4

    Awesome explanation as always. Keep the videos coming!
    Just a question, can't we take 'low' as the max of the array? Because in any given array, there would be a student (partition) having maximum number of pages, and hence the max sum would be greater than or equal to the max value.
    Taking 'low' as the max of the array would potentially reduce the search space.

  • @dhavalparmar9661
    @dhavalparmar9661 Před 3 lety +1

    A slight correction on 24:03
    if( pages+arr[i] > barrier){
    allocatedStu++;
    pages = arr[i] // Instead of pages+=arr[i];
    }

  • @rohanchoudhary672
    @rohanchoudhary672 Před 3 lety +4

    Saw your LinkedIn post sir.
    This white board is surely a boon for our learning.

  • @sarthakgupta1842
    @sarthakgupta1842 Před 10 měsíci

    Nice and unique explanation striver thanks a lot

  • @MusingsbyAmit
    @MusingsbyAmit Před 3 lety

    Anyone one who is looking to learn DSA - this is the best channel I think. It will certainly take u forward.

  • @iamankitmishra
    @iamankitmishra Před rokem

    I can understand it takes energy to speak so clearly and explain.......thanks. God bless you success.

  • @gouravkumar7459
    @gouravkumar7459 Před 2 lety

    came here after Binary Search Master Class, although i have done this question but wanted to go through your video once

  • @sunitsable2752
    @sunitsable2752 Před 3 měsíci

    Amazing understood the whole approach ,You r just cool.

  • @mohdaasimqureshi7115
    @mohdaasimqureshi7115 Před 3 lety +7

    this way of teaching is far better than the previous way. Pls continue teaching us in this way only
    btw you explained it exceptionally well👌👌 and thank you for all ur efforts that u r putting in for us🙏
    More power to you bhaiyya 🙌

  • @tanishaguptacse2032
    @tanishaguptacse2032 Před rokem

    You made the complexity so easy... Thank you so much for the explanation

  • @swapnilkumar4411
    @swapnilkumar4411 Před 3 lety

    Bhai ek dum se 🔥🔥🔥 2-3 videos me samajh me nahi aa Raha tha.. aapke videos se pura concept pata lag gaya

    • @takeUforward
      @takeUforward  Před 3 lety

      2-3 videos dekhna hi kyu h jb TUF ka video h XD

  • @archanamahour4409
    @archanamahour4409 Před 3 lety +2

    Binary search can be applied to a sorted array,
    What if question includes an unsorted array and we are not allowed to sort the array???
    Then what will be the solution???

    • @takeUforward
      @takeUforward  Před 3 lety

      I am applying binary search on the search space bro, not on the array. Carefully see. Please watch my previous videoszz

  • @aqua6150
    @aqua6150 Před 3 lety

    At 24:00 it should be pages = arr[i] otherwise that if loop condition will always be true . As we did student++ so we are reinitializing the vaule of pages as arr[i] as it will calculate the sum for the other student.

  • @sharathnair2790
    @sharathnair2790 Před 3 lety +5

    This setup is a great upgrade brother.
    P.S. best online lecture of my life❤️

  • @rajveersingh2056
    @rajveersingh2056 Před rokem

    Big fan bro, Awesome work, But i feel you can binary search the is_possible function as well by using the extra space of N where you store "sum till now".
    this way, it can be done in log(n)*log(n) time
    a = [12, 34, 67, 90]
    sum_a = [12, 46, 113, 203]
    students = 3
    def is_possible(left, b, settled, used_students):
    right = len(a) - 1
    if settled == sum_a[-1]:
    return True, used_students
    while left > 1
    if a[mid] > b:
    return False, used_students
    e_mid = sum_a[mid] - settled
    if e_mid students:
    return False, count
    return True, count
    print(is_possible(left=0, b=b, settled=0, used_students=0))

  • @ruiqiu9947
    @ruiqiu9947 Před 10 měsíci

    Dude made the funniest algo tutorial!=

  • @noobcoder7827
    @noobcoder7827 Před 3 lety +16

    Appreciate man for using pen and board

  • @KRISHNAKUMAR-rk7bv
    @KRISHNAKUMAR-rk7bv Před 3 lety +3

    This much of energy at 3:00 AM with such an amazing explanation, man you're great, hats-off.

  • @arpit27953
    @arpit27953 Před 2 lety +1

    Steps to follow for this kind of problem
    step 1:Think of the search space.
    step 2:Than write the function which gonna tell us that the value is good for becoming the ans.
    step 3: If yes update ans move to left else move to right.

  • @RohitSharma-bq1px
    @RohitSharma-bq1px Před 2 lety

    one of the best video i have seen with the kind of explation and dedication
    Thanku for this

  • @kunal_chand
    @kunal_chand Před 3 lety +2

    Back to basics. Whiteboard tutorials gives a great vibe for learning!!

  • @jaiminsolanki5478
    @jaiminsolanki5478 Před 3 lety +1

    Raj Bhaiya, the energy with which the video is made, it was so engaging ,so crisp and clear! Thankyou so much brother!

  • @gourabbhattacharjee2128

    I have fallen in love with your teaching style! You can teach us whatever you like!

  • @manavpandey2246
    @manavpandey2246 Před 3 lety +2

    Bhai literally you're best in teaching complex problems into simple solutions want to see more such videos ahead.
    keep doing such good work and motivating students like us.

  • @siddharthchaudhary2320
    @siddharthchaudhary2320 Před 3 lety +1

    Great approach...never thought one could explain binary search soo easily..

  • @tokirmanva2247
    @tokirmanva2247 Před 3 lety +4

    small correction Bro
    at 23:59
    pages = arr[i];
    BTW Love your content Brother!!

    • @satyamsrivastava.
      @satyamsrivastava. Před 3 lety +1

      I was looking for this correction only in the comments otherwise I was going to post.... Thanks

    • @ShubhamKumar-et7gx
      @ShubhamKumar-et7gx Před 3 lety

      But how please explain I did't get it..🙏

  • @its_neel_ok
    @its_neel_ok Před 3 lety

    the explanation was as clear as a crystal . I could'nt understand the question but now it totally clear. THANKS A LOT !!!

  • @ekjotsingh9609
    @ekjotsingh9609 Před 3 lety

    The video helped me realize the power of binary search. Didn't know it could be used in such a way. Thank you.

  • @gajrajgurjar6224
    @gajrajgurjar6224 Před 2 lety

    striver bhaiya❤ are bhaiya itni clearity ke sath to koi nhi pdata h aap to yaar really me hard se hard problem ko bhi aasani se easy kr dete ho

  • @ayushjain7130
    @ayushjain7130 Před 3 lety +1

    At 24:00 , after allocatedStudent += 1 , I think next line should be pages = arr[i] instead of pages += arr[i], because if we are moving to next student, there will be some value of pages for previous student (If I understood it correctly)
    Correct me if I am wrong, BTW great explanation, and whiteboard makes the explanation better

    • @takeUforward
      @takeUforward  Před 3 lety +1

      I have updated about this in the pinned comment and description. Thanks

  • @just4commentsable
    @just4commentsable Před 2 lety +1

    Thank you for this video. Incredible explanation. This problem felt so complicated for me at first, I didn't think I could solve it. You really helped simplify this!!!

    • @sachinpathak3084
      @sachinpathak3084 Před 2 lety

      bro tell me one thing the time complexity of binary search is wrong in the video since the search space is not N but its M = (Sum(arr)-Max(arr)+1)

  • @stith_pragya
    @stith_pragya Před rokem +1

    Thank You So Much Striver Brother...........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @krishnapurwar1738
    @krishnapurwar1738 Před rokem +1

    kudos to your efforts to making such type of videos for us.

  • @shubhamchavan386
    @shubhamchavan386 Před rokem

    inside the isPossible function inside first if condition it should be pages=arr[i] instead of pages+=arr[I
    ]

  • @mugambo5505
    @mugambo5505 Před rokem

    bro your explanation is just next level. i don't think i will ever ever forget this queston

    • @Sakshi01188
      @Sakshi01188 Před rokem

      do you have the github link for this question

  • @ankitkumaryadav562
    @ankitkumaryadav562 Před 3 lety +1

    Best explanation on this problem

  • @user-pd1qv6zo9w
    @user-pd1qv6zo9w Před rokem

    Hello, At time 24:17 you have written pages+=arr[i] while it should pages = arr[i] as we will restart adding pages for current student. I was getting WA for this.
    Otherwise great explanation bro 👌

  • @DeepSingh-zs2oi
    @DeepSingh-zs2oi Před 2 lety

    Thanks for explaining the search space idea. This gives the intuition for using binary search in such problems.

  • @jayantk137
    @jayantk137 Před 3 lety

    Sorry to say Apni kasha ka dekhkr aaya explanation .. smjh me nhi aaya .
    but raj bhaiya ka dekhkr aa gya smjhe me
    thanks alot bhaiya

  • @pratimadash1372
    @pratimadash1372 Před 2 lety

    I almost gave up on this question, but your explanation exceeded my highest expectations, you deserve a lot more sir, hats off to you.

  • @beginnersbaggage5187
    @beginnersbaggage5187 Před 2 lety +1

    Well explained brother. I came to your video after watching gfg self paced course video on this topic. I didn't get much clarity of the approach there but the way you explained it, Hats off dude.🤘

  • @kshittizbhardwaj417
    @kshittizbhardwaj417 Před 3 lety +2

    great explanation as always!!! Also regarding the whiteboard, you just continue with whatever way makes you comfortable but you know our obsession with dark mode and dark IDEs so I personally liked the previous way but as long as you are teaching it's all good!!

  • @learn_with_yourself
    @learn_with_yourself Před 3 lety

    Why yur allocate fn return true even stuents

  • @gaishiya7696
    @gaishiya7696 Před 3 lety

    bruh I honestly don't know how someone can devote himself completely to teaching!!!

  • @rishavraj1536
    @rishavraj1536 Před 3 lety +1

    bhaiya maaja aa gya ekdum feeel aaa gyaa bhaiyaaaa ekdum ..loved white board...bhaiya aage ki videos white board pe bnana bhaiya

  • @mihirbhasin1970
    @mihirbhasin1970 Před 3 lety +1

    Bhai if I was not in 3 year I would have been Google ready kya he revision horha op stuff brother keep it up..

  • @CodeMode9313
    @CodeMode9313 Před rokem

    axctually i was seeing the updated video of ur binary search but didnt got why low was maximum then i came to see this video but realised that it was wrong here so i understood what went wrong .

  • @shakyasachinkumaratarsingh7266

    Excellent Explaination !

  • @ShahNawaz-cx3pi
    @ShahNawaz-cx3pi Před 3 lety

    I have a doubt :-
    if(alloc-student>k)
    return false; (this is clear)
    else if( alloc-student==k)
    return true ; ( this is also clear,
    because this is one possible ans).
    Else if(alloc-student

  • @sourabhkumar6194
    @sourabhkumar6194 Před 2 lety +1

    those small tips about interview like not telling dp solution to save time makes this channel special

  • @deepakkamat7728
    @deepakkamat7728 Před 3 lety +1

    The teaching way is Phenomenal 🔥🔥

  • @chaitanyakumar9229
    @chaitanyakumar9229 Před 3 lety +3

    actually, we have to return false even when alllocstu = k , so as to find the min pages (kind of like how lower bound works)

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr Před 3 lety

      int when int is starting with 0, but in the video his count is starting with 1.

  • @abhayrai1724
    @abhayrai1724 Před 3 lety +1

    Better than last mode of teaching ❤️❤️❤️🔥🔥🔥🔥🎉🎉🎉

  • @tanguduraviteja6087
    @tanguduraviteja6087 Před 3 lety +1

    low will be the maximum element of the array right? not the minimum element of array naa?

  • @anveshasharma2726
    @anveshasharma2726 Před 3 lety +1

    Like always great bhaiya and really love your series. Mujh se pahle ds algo question solve hi nhi hote the but ab mujhe samajh bhi aachi tarah aa jata h bde aaram se. THANKS TO YOU FOR THE SAME

  • @ritikkumarjain2094
    @ritikkumarjain2094 Před 3 lety

    How enthusiastic! Helps me a lot! May all girls of the world have crush on you..................................

  • @adityaramakrishnan969
    @adityaramakrishnan969 Před 3 lety

    How can anyone be so fresh while teaching at 3AM?!!! Thumbs up bro

  • @prakharjain1228
    @prakharjain1228 Před rokem

    at 24:02 It should be pages = arr[i], instead of pages += arr[i] or make page=0 and then pages+=arr[i];

  • @Musclehead07
    @Musclehead07 Před 2 měsíci

    great effort.

  • @jayachandra677
    @jayachandra677 Před 3 lety

    This is the best intuition behind this problem ever!!! Thanks, bhaiya!!!

  • @simmi641
    @simmi641 Před 6 měsíci

    Thank you striver❤

  • @adishijha8365
    @adishijha8365 Před 3 lety +2

    It's really inspiring to see that you are putting so much efforts for us. Thank you!

  • @anuragtiwari9793
    @anuragtiwari9793 Před rokem +2

    if(allocated > B)
    return false;
    return true;
    In above line, if allocated is lesser than B, that means all the students have not been allocated books. So why are we returning true here?

    • @unknownanonymous1335
      @unknownanonymous1335 Před rokem +1

      I'm also have the same doubt. If you get the answer please share here bro

    • @zackviper1901
      @zackviper1901 Před rokem

      Allocated is not lesser than B .it means after the execution of for loop the pages will be assigned to each student under given conditions ie why return true..

  • @cricketsmile2533
    @cricketsmile2533 Před 2 lety

    your teaching method is very attractive,
    wish u all the best

  • @dookiedoo2
    @dookiedoo2 Před 3 lety

    if(n

    • @hassanmohammed904
      @hassanmohammed904 Před 2 lety

      I have the same doubt ... But how should we update our search space in such a case case