Aggressive Cows | Binary Search | BS-17. Aggressive Cows | Binary Search Hard

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024
  • Please watch our new video on the same topic: • BS-17. Aggressive Cows...
    Check our Website:
    Notes: • BS-17. Aggressive Cows...

ความคิดเห็น • 272

  • @takeUforward
    @takeUforward  ปีที่แล้ว +1

    Please watch our new video on the same topic: th-cam.com/video/R_Mfw4ew-Vo/w-d-xo.html

    • @artofwrick
      @artofwrick 8 หลายเดือนก่อน

      Problem in leetcode : Magnetic force between 2 balls. Leetcode...

  • @jashanbansal2613
    @jashanbansal2613 3 ปีที่แล้ว +154

    Aggressive Striver :)

  • @rogerop6721
    @rogerop6721 3 ปีที่แล้ว +368

    similar question on leetcode ->
    1552. Magnetic Force Between Two Balls
    1870. Minimum Speed to Arrive on Time
    875. Koko Eating Bananas
    1011. Capacity To Ship Packages Within D Days
    1283. Find the Smallest Divisor Given a Threshold
    1482. Minimum Number of Days to Make m Bouquets
    2064. Minimized Maximum of Products Distributed to Any Store

    • @marvel438
      @marvel438 3 ปีที่แล้ว +2

      Thank you man. Really appreciate it

    • @rogerop6721
      @rogerop6721 3 ปีที่แล้ว

      @@marvel438 welcome

    • @kage-musha1702
      @kage-musha1702 3 ปีที่แล้ว +17

      1231 Divide Chocolate
      774 Minimize Max Distance to Gas Station
      410 Split Array Largest Sum
      these too :D

    • @vasujain1970
      @vasujain1970 3 ปีที่แล้ว

      nice, thanks!

    • @rithikdutt1332
      @rithikdutt1332 3 ปีที่แล้ว

      Thankss!

  • @anujjain9273
    @anujjain9273 3 ปีที่แล้ว +10

    for all those who are confuse , at 3:21 the c2 should be drawn under the stall 8 column not under stall 4 , although explanation was good

  • @soumyadipbhowmik2220
    @soumyadipbhowmik2220 ปีที่แล้ว +10

    Your explanaining capabilities are absolutely beautiful. People really be coding it out without thinking the approach which you did beautifully.

  • @takeUforward
    @takeUforward  3 ปีที่แล้ว +26

    Checkout out playlist for all DSA in the description.
    Follow me at Instagram for updates: Striver_79

    • @prithvijitbasak
      @prithvijitbasak 3 ปีที่แล้ว

      Thank you sir for this video. This question was not clear for me after watching a video on this question on TH-cam.
      But your explanation is extraordinary ❤️🔥. It's crystal clear for me now.
      Keep making more these top notch quality content. ❤️❤️🔥.

    • @worldaffairs2.060
      @worldaffairs2.060 3 ปีที่แล้ว

      Hindi mein bbhi pdahye sir

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr 3 ปีที่แล้ว

      high=arr[n-1]-arr[0]

    • @georgebell1927
      @georgebell1927 2 ปีที่แล้ว +1

      Striver is the dsa playlist the solns for the sde sheet that u prepared.For example does the linked list playlist consists of the solutions to the linked list problems in the sde sheet.Please answer because if they are the solns i ll watch them after trying the sde sheet.

  • @nikhilrana2680
    @nikhilrana2680 3 ปีที่แล้ว +73

    Aggressive cows , explained in a calm manner, striver bhaiya op🔥

    • @vinaygupta2369
      @vinaygupta2369 2 ปีที่แล้ว +1

      He was also agressive in making solution understood :)

  • @mohitbajaj4465
    @mohitbajaj4465 2 ปีที่แล้ว +4

    we can also take low as the minimum gap between the consecutive element alfter sorting. For example if the array is
    10 50 100 200.
    then we can take low as 40. because that can be the minimum ans if the number of cows is 4. This will reduce the time complexity for binary search. Please correct me if i am wrong.

    • @lakshsinghania
      @lakshsinghania ปีที่แล้ว

      yeah, ig coz in book allocation problem the search space was from max_element ---- sum of all elements
      altho here we are not finding the sum as the problem statement is diff we need the min distance that is low till the end

  • @rudraprasaddash3809
    @rudraprasaddash3809 2 ปีที่แล้ว +8

    Thank you bhaiya for this amazing explanation. But, the "NOOO! WHY?" at 10:40 is epic🤣

  • @sumitanand6249
    @sumitanand6249 2 ปีที่แล้ว +33

    More Good Binary Search Problems (Leetcode).
    Good luck and have fun!
    1539. Kth Missing Positive Number
    1482. Minimum Number of Days to Make m Bouquets
    1283. Find the Smallest Divisor Given a Threshold
    1231. Divide Chocolate
    1011. Capacity To Ship Packages In N Days
    875. Koko Eating Bananas
    774. Minimize Max Distance to Gas Station
    410. Split Array Largest Sum

  • @gowthamvb418
    @gowthamvb418 ปีที่แล้ว +1

    Everything in this video is clear and excellent.
    However I couldn't figure out the below. Can Anyone explains me to clear it out.
    Why we need to place our first cow in first stall. Placing the first cow in different(next) stalls leads to different answer right?
    Also why are we assuming min distance of cow as firstly placed two cows, i.e., stall[0] and next upcoming stall[i] that covers min distance, probably min distance will be on next upcoming stalls as well right?
    Hoping to get clear my doubts. Thanks.

  • @xZero_.
    @xZero_. 5 หลายเดือนก่อน

    Incredible Explanation, Thanks for the Tutorial!

  • @aniketbhusal3489
    @aniketbhusal3489 3 ปีที่แล้ว +4

    Your explanation and the topic clearance has grown exponentially with whiteboard, you are gonna progress a lot for sure , no looking back.

  • @rounakmukherjee9540
    @rounakmukherjee9540 2 ปีที่แล้ว +2

    Thanks for those 2 Gems... those are really something that I am searching for .
    Both in book allocation and Aggressive cows question's, you give a quality explanation that Isolved some similar question like that by my own. Thank you.

  • @varshinielangovansumathi6563
    @varshinielangovansumathi6563 3 ปีที่แล้ว +6

    Hi! Please upload a video on Time and Space Complexity if possible . I just finished watching your C++ STL video today. You're doing a great job👏. I really like the way you explain things🥺🔥 Thanks a ton 🙏❤️

  • @rishabhgupta947
    @rishabhgupta947 ปีที่แล้ว +1

    Can someone explain why we are always assuming cow1 to be at index 0. At 19:30 mins in video co-ord = a[0] ? Can there not be any case when 1st cow is placed at any other index other than zero ?

    • @trysha2340
      @trysha2340 ปีที่แล้ว

      We need the best solution, thus the best solution is to place first cow in the first stall, and then from onwards we will get the best solution automatically.

  • @sandeepnallala48
    @sandeepnallala48 3 ปีที่แล้ว +6

    Bro i knew this prblm and still came here see the way u explain, and just after starting hit the like 💯💯💯. Great wrk bro

  • @vikashgupta3305
    @vikashgupta3305 3 ปีที่แล้ว +2

    Haye your excitement in 10:52, excites me I get more Interested in Q after seeing your interest and energy, which matters me the most for my love of coding. You're true gems in our community I seriously admire your nature and thought process.❤️

  • @jaiminsolanki5478
    @jaiminsolanki5478 3 ปีที่แล้ว +4

    Bro the way u teach, the energy, makes learning so fun and interesting....tysm Brother!

  • @ayushagarwal2091
    @ayushagarwal2091 3 ปีที่แล้ว +6

    Your hard work and dedication can be clearly seen from ur eyes🙏🙏🙏

  • @devvratsaxena8962
    @devvratsaxena8962 3 ปีที่แล้ว +10

    This is honestly one of the best explanation for all the questions I came across ever on youtube. Thanks sir for such awesome content.

  • @naro.tam_
    @naro.tam_ 2 ปีที่แล้ว +2

    Thanx Striver Bhaiya.came here from your Binary Search master class and I easily solved all the below listed questions .Thanx for these amazing concepts

  • @giridharjadala2182
    @giridharjadala2182 2 ปีที่แล้ว

    It was pretty tough to figure out the search space right after going through the question, but your intuition was really good.

  • @cenacr007
    @cenacr007 2 ปีที่แล้ว +1

    why is lowest possible distance 1 ? lowest possible should be when 2 cows are placed sided by side in the first 2 stalls with minimum values, but no body said the distance between first 2 stalls will be guaranteed 1, what if the array is 1 3 5 7 9, will we ever have a min distance 1 b/w 2 cows in such a case ? I think it should be arr[1] - arr[0] after sorting the array. Can somebody explain ?

    • @codetogether24x7
      @codetogether24x7 2 ปีที่แล้ว

      same doubt bhai

    • @lakshsinghania
      @lakshsinghania ปีที่แล้ว

      yeah the search space will be more specifically low will be after sorting arr[1] - arr[0]

  • @gauravgupta5530
    @gauravgupta5530 2 ปีที่แล้ว +1

    18:58
    How to place cows;

  • @samreenimam8608
    @samreenimam8608 8 หลายเดือนก่อน

    we're finding " do ke bich ki duri jitna ho sake badha do., but within given stalls".

  • @ratnadeepbhattacharya3237
    @ratnadeepbhattacharya3237 3 ปีที่แล้ว +1

    Bhaiya classes k din yaad a gye..... Loved it...... Nd all thanks to u for making such a tough prblm bread and butter.....

  • @kaustav07
    @kaustav07 3 ปีที่แล้ว +3

    Kindly include painters partition too please.

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว +5

      Its same as allocation of minimum pages, exactly same problem..

  • @arihantjha7062
    @arihantjha7062 3 ปีที่แล้ว

    I don't understand, why the first cow always has to be plased at the first given co-ordinate?

    • @chhatrapathisivajilakkimse8108
      @chhatrapathisivajilakkimse8108 2 ปีที่แล้ว

      Exactly ! that's where I'm stuck . Like there could be other combination from the list which might get possible for given mid . Please can anyone explain this

    • @kavitgangar2510
      @kavitgangar2510 2 ปีที่แล้ว

      Because we want to know whether we can place the cows at a min distance of 'dist'.
      So, if by placing the cow at the first co-ordinate, we cannot get a configuration where the dist between consecutive cows is >= dist, then by placing the first cow at any other position as well we wont get any configuration

  • @SidNegi2511
    @SidNegi2511 3 ปีที่แล้ว +3

    3:20 konse nashe h? How the hell difference of 2 and 4 is 6😢 and difference of 4 and 9 is 1

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว +1

      Slider corrected it..

    • @SidNegi2511
      @SidNegi2511 3 ปีที่แล้ว

      @@takeUforward btw you explain things very well.. abhi tak 2 videos dekhi h lekin concepts bahut badhiya or clarity ke saath smjh aajate h..

  • @Dead_Zone_0922
    @Dead_Zone_0922 2 ปีที่แล้ว

    i invest my time to understand 7 hours i have made many times dry and run i try to solve it using sliding window and brute fornce and binary search but i couldn't now i understood complitely thank u bro thank u so mcuh ........

  • @abhishekkumarsingh8603
    @abhishekkumarsingh8603 3 ปีที่แล้ว

    Ek dum mast sequential way mein aa rha hai video pura thought process bana diye hai pura relate kar paye pichle video se pehle toh q dekh ke pata hi nhi chalta tha ki binary search ka q hai 😊

  • @hassanmohammed904
    @hassanmohammed904 2 ปีที่แล้ว

    Why does the first cow have to be at the left extreme?

  • @kunal_chand
    @kunal_chand 3 ปีที่แล้ว +3

    Is this question a part of the SDE sheet, because I can't find it in any section.
    Anyway, Kudos to your efforts!

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว +2

      Binary search, please use the google doc version, and don't download it!! As I keep updating it..

    • @abhishekkumarsingh8603
      @abhishekkumarsingh8603 3 ปีที่แล้ว +12

      @@takeUforward kuch ladke humare pehchan ke hardcopy nikaal ke highlighter chalate hai sde sheet pe unka kya kiya jaye😂

    • @manavshah7450
      @manavshah7450 3 ปีที่แล้ว

      @@abhishekkumarsingh8603 hahaahahahaahahah

  • @ashwinshetgaonkar6329
    @ashwinshetgaonkar6329 3 ปีที่แล้ว +1

    intuition behind each step nicely explained.

  • @heyrmi
    @heyrmi 3 ปีที่แล้ว +1

    there is a drastic improvement from video-1 of whiteboard. you are improving by each video.

  • @harshavardhanbashavathini6534
    @harshavardhanbashavathini6534 2 ปีที่แล้ว

    I did not understand, taking arr[0] for the first cow.(Greedy Approach). Please explain

  • @sankalpjain4841
    @sankalpjain4841 2 ปีที่แล้ว +1

    Please, can anyone explain, why to take low=1, instead of low=xi[1]-xi[0] in binary search approach.
    ThankYou in advance

    • @naveensingh2658
      @naveensingh2658 2 ปีที่แล้ว

      1 will be the lowest possible minimum distance.

    • @cenacr007
      @cenacr007 2 ปีที่แล้ว

      ​@@naveensingh2658 why, lowest possible should be when 2 cows are placed sided by side in the first 2 stalls with minimum values, but no body said the distance between first 2 stalls will be guaranteed 1, what if the array is 1 3 5 7 9, will we ever have a min distance b/w 2 cows in such a case ? I think it should be arr[1] - arr[0] after sorting the array.

    • @arnavagrawal3499
      @arnavagrawal3499 2 ปีที่แล้ว

      @@cenacr007 No actually there could be a case for ex. - 3 6 9 10 11 13 where we need to place 6 cows then min possible would be 1 in that case so in my opinion it should be actually min(arr[i + 1], arr[i]) for i = 0 till size - 2 index (in this case till 4th index) but it doesn't matter even if we take 1 as the minimum because the final answer will only give the maximum possible minimum distance.

    • @amanbhadani8840
      @amanbhadani8840 2 ปีที่แล้ว

      More accurately i say low is the minimum value among all the consecutive differences of elements.

  • @swapnanilgupta3046
    @swapnanilgupta3046 ปีที่แล้ว

    Great explanation. I understand that we have to be greedy and place the first cow always at the first position, but if after doing that we do not arrive at the solution, can no other solution exist if place the first cow at 2nd/3rd position and then try to place rest of the cows?

  • @ethanhunt8989
    @ethanhunt8989 3 ปีที่แล้ว +1

    I am a little confused abt this part
    how do we set for a particular problem high = mid-1 or high = mid in some other problem and low

    • @saketsharma133
      @saketsharma133 2 ปีที่แล้ว

      I think -
      When you are using high = mid -1 and low = mid +1, then use low

  • @sidharthjain7229
    @sidharthjain7229 2 ปีที่แล้ว

    Sir why are we always picking the first position as optimal in the canPlaceCows function?

  • @amanali9501
    @amanali9501 2 ปีที่แล้ว

    at 14:02 why c1 and c2 is kept at 1 and 4 , it should be at 2 and 4

  • @rohitbagade9182
    @rohitbagade9182 2 ปีที่แล้ว

    what if instead of 9 there is 12.
    now if we try for ans 4
    c1 = 1
    c2 = 8
    c3 = 12
    c1-c2 = 7
    c2-c3 = 4
    we can get ans for 4 , by evaluating c2-c3.
    if we only check c1-c2, then i guess we'll miss this testcase. (instead of 9, 12)

  • @aditya_jaiswal.
    @aditya_jaiswal. ปีที่แล้ว

    After lot of struggle through many videos finally here I understood this concept 🥰.
    Kisko credit diya jaye meri mehanat ko ya striver bhaiya❤ ko. yrr sach me book allocation problem ke bad 2 dino se samjhne ki koshish kar rha tha🤒😅

  • @scooby-doo7628
    @scooby-doo7628 3 ปีที่แล้ว

    Hi, I know you are busy, recently i have gone through you segment tree with lazy propagation lecture, the concept u provide is amazing. Can you please make a video on persistent segment tree when you are free?

  • @subhajeetchakraborty1791
    @subhajeetchakraborty1791 2 ปีที่แล้ว

    Your excellent art of explaining these questions has inspired me to not lose hope and improve my problem solving skills further

  • @Bhatkal_Vlogger
    @Bhatkal_Vlogger 2 ปีที่แล้ว

    how can you place three cows 10:52 mast bhaiya

  • @lawbindpandey402
    @lawbindpandey402 2 ปีที่แล้ว

    The lesson learnt here is that : "Binary Search can also be used to find max value of a monotonic function" .....

  • @radhikachaudhary2366
    @radhikachaudhary2366 ปีที่แล้ว

    I have one doubt, you said if it's an unsorted array then sort it . Then after sorting ,the distance between the coordinates will change and perhaps answer will also change

  • @wisdomkhan
    @wisdomkhan 2 ปีที่แล้ว

    Thanks to your previous videos, and intelligent ordering of questions in the SDE sheet, I did this on my own. Thanks bhai :)

  • @lasanihussain8810
    @lasanihussain8810 2 ปีที่แล้ว

    Here after binary search master class, was able to do aggressive cows on my own.

  • @nileshsinha7869
    @nileshsinha7869 3 ปีที่แล้ว +1

    Understood ❤❤ Great Explanation ..keep this coming

  • @wian7284
    @wian7284 3 ปีที่แล้ว +1

    "Definitely not!"😅😂 Reminds me of Dhoni saying this :p

  • @nabajyotideka9211
    @nabajyotideka9211 2 ปีที่แล้ว

    What If we wanted to find smallest minimum distance in this problem? I think instead of going only to mid + 1 to high in success scenario at mid we must explore low to mid - 1..... M I right plz answer this?

  • @012akashh
    @012akashh 3 ปีที่แล้ว

    You are superb buddy ..so hard working where do you get this inspiration from ? Just finished looking the last video and new one is ready 😊

  • @saurabhanand6590
    @saurabhanand6590 3 ปีที่แล้ว +1

    can we use lower bound in can place cows function??
    This way the time complexity other than sorting will be O((logn)^2)

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว +1

      Yes you can, it will become a bit complex though. Also the worst case of that too is N. imagine cows=n and stalls being 1,2,3...

    • @saurabhanand6590
      @saurabhanand6590 3 ปีที่แล้ว

      @@takeUforward Thanks for the reply... I actually implemented the approach on leetcode and its runtime is higher than the linear ones.

    • @saurabhanand6590
      @saurabhanand6590 3 ปีที่แล้ว

      @@takeUforward The Worst case time for lower bound will be O(log n) as it uses binary search

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว +1

      @@saurabhanand6590 you cannot directly apply a single lower bound.. you have to apply for every cow bro.. so takes more time rather..
      For C cows it becomes C*log n

    • @saurabhanand6590
      @saurabhanand6590 3 ปีที่แล้ว +1

      @@takeUforward Yes got your point bro... Thanks again

  • @cinime
    @cinime ปีที่แล้ว

    Understood! Super awesome explanation as always, thank you very much!!

  • @aadityabedi3140
    @aadityabedi3140 3 ปีที่แล้ว +1

    Bhaiya thanks for this video and Tree series kab tab ayegi please bta do placements aane vali hai hamari

  • @stith_pragya
    @stith_pragya ปีที่แล้ว

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

  • @mohammadumaidansari5087
    @mohammadumaidansari5087 3 ปีที่แล้ว +2

    Another best one from the best 👍💯

  • @heyrmi
    @heyrmi 3 ปีที่แล้ว

    Bhaiya it would be great if you can also tell the companies in which the questions are asked. Many of us don't even have a clue of frequency and company in which questions are mostly asked. It helps a lot

  • @ayushjain9723
    @ayushjain9723 2 ปีที่แล้ว

    One of the best explanation thanks Striver ! ❤❤

  • @makaty9883
    @makaty9883 ปีที่แล้ว

    thank you striver, i really appreciate that man!!

  • @PranavPrajapati-hd2eu
    @PranavPrajapati-hd2eu ปีที่แล้ว

    Gone through all other video on this question. But this one is amazing

  • @rajarshitiwari9896
    @rajarshitiwari9896 3 ปีที่แล้ว

    If the array is [16,17,18,0] and we have to place two cows then how will give the right answer as we will always start with a[0] i.e 16 and can never get 18,0 as answer which is the largest smallest value possible

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว

      sorting is important, that's why i said...

    • @rajarshitiwari9896
      @rajarshitiwari9896 3 ปีที่แล้ว

      @@takeUforward yeah...
      Missed the way..
      Thanks as always..

  • @dudamneerajdattu1459
    @dudamneerajdattu1459 ปีที่แล้ว

    today's codestudio's moderate difficulty problem, and i understood the approach but somewhere I am struggling to code

  • @englishlnowledge486
    @englishlnowledge486 2 ปีที่แล้ว

    For this question array must be sorted?

  • @adityajain1205
    @adityajain1205 2 ปีที่แล้ว

    why we are placing 1st cow each time at 0th index. can someone help?

  • @sakshamsrivastava6280
    @sakshamsrivastava6280 3 ปีที่แล้ว

    great explaination.Thankyou for providing this

  • @tharunkumar1358
    @tharunkumar1358 ปีที่แล้ว

    why are wee sorting the stalls array??

  • @meghnagupta3907
    @meghnagupta3907 2 ปีที่แล้ว

    Vry nice explanation got every bit and learn something new. tysm

  • @baz2839
    @baz2839 ปีที่แล้ว

    to place cow at 1st position we need to sort array otherwise we wont get correct answer

  • @shivayvinaik7794
    @shivayvinaik7794 2 ปีที่แล้ว

    amazing explanation mann!!!!!!!!!!!!!!!!! thank you so mucchhhh

  • @bhavaymalhotra6452
    @bhavaymalhotra6452 3 ปีที่แล้ว

    Bhaiya ismai sort karna zaruri kyu h array ko ?? unsorted array par binary search on answer nhi nikal sakte??

  • @GdLongerHandle
    @GdLongerHandle 3 ปีที่แล้ว +3

    The energy 👀⚡⚡

  • @ayushaneja9076
    @ayushaneja9076 2 ปีที่แล้ว

    can we also start placing cows from backward like from largest to lowest

  • @vinodashok1793
    @vinodashok1793 ปีที่แล้ว

    Thank you bhaiya. Great explanation

  • @rishabhgupta9846
    @rishabhgupta9846 ปีที่แล้ว

    After getting initial intuition able to solve by myself,thanks striver

  • @devkumaracharyaiitbombay5341
    @devkumaracharyaiitbombay5341 ปีที่แล้ว

    bhai mind blowing your efforts in this video make my dsa journey easy
    love you so much bro.
    keep making this type of video in **WHITE BOARD

  • @diyamalaka5924
    @diyamalaka5924 2 ปีที่แล้ว

    why is the low 1 and not min. of the diff?

  • @saurabhahuja6707
    @saurabhahuja6707 2 ปีที่แล้ว

    Possible combinations are 5c3 i.e 10

  • @meetjoshi4521
    @meetjoshi4521 ปีที่แล้ว

    great explanation sir

  • @nayanjha5670
    @nayanjha5670 2 ปีที่แล้ว

    bhaiya is question me array jo milega wo sorted format me milega?

  • @Finimals
    @Finimals ปีที่แล้ว

    This is a very good explanation

  • @sketchwithbratati4397
    @sketchwithbratati4397 3 ปีที่แล้ว

    Amazing explanation striver❤️👍🏻

  • @surajjadli1747
    @surajjadli1747 3 ปีที่แล้ว

    Like the thumbnail simple 👌 just need to show front face.😄🏋🔥🔥🔥

  • @subratarajak8391
    @subratarajak8391 3 ปีที่แล้ว +2

    Another masterpiece... ❤from CGEC bhaiya

  • @soumikdutta7867
    @soumikdutta7867 3 ปีที่แล้ว

    Bhaiya kaya explain kiya ho !!! Lit !! Love this explanation :-)

  • @chaitanyakumar9229
    @chaitanyakumar9229 3 ปีที่แล้ว

    similar to arrange books -> which are all based on painters partition alogo 😁👍

  • @geekySRM
    @geekySRM 3 ปีที่แล้ว

    Beauty bhai! Jabardast explanation!

  • @siddharthupadhyay4246
    @siddharthupadhyay4246 2 ปีที่แล้ว

    Thank you sir, great explanation

  • @shantanumapari6679
    @shantanumapari6679 2 ปีที่แล้ว

    very lucidly explained!!

  • @Ankit.yt_885
    @Ankit.yt_885 2 ปีที่แล้ว

    Very Nicely Explained :)

  • @aravakrishnaveni1801
    @aravakrishnaveni1801 3 ปีที่แล้ว

    Your explanation is amazing sir

  • @rajat7584
    @rajat7584 3 ปีที่แล้ว

    Poori B.Tech nikal gayi par ye question ek baar me kabhi solve nahi hua 😂. Ab MS karte hue dekh raha hun. Thanks bro😀

  • @surendrapandey4660
    @surendrapandey4660 3 ปีที่แล้ว

    make a video on finding the kth smallest element in a binary search tree in O(N) time and O(1) space.

    • @aj9706
      @aj9706 2 ปีที่แล้ว

      U just have to search that's it ... It remains O(n)

    • @surendrapandey4660
      @surendrapandey4660 2 ปีที่แล้ว

      Yeah I got it afterwards, we have to just do the inorder traversal and then keep on counting the nodes which we have visited till now. Whenever we visit a node we increment the count and then we check if that count is equal to k. If it is, then we return that element otherwise we keep on doing the traversal.

  • @nayankhanna2367
    @nayankhanna2367 3 ปีที่แล้ว

    Great explanation!

  • @ChaurasiaAnkur8
    @ChaurasiaAnkur8 2 ปีที่แล้ว

    Why low is 1 ? can someone help me ?

  • @chayanjain6902
    @chayanjain6902 3 ปีที่แล้ว

    Sir when will stack and queue solutions will come?

  • @MangoLassiYT
    @MangoLassiYT 2 ปีที่แล้ว

    such clean explanation ❤