L16. Sliding Window Maximum | Stack and Queue Playlist

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 45

  • @kshitijsingh879
    @kshitijsingh879 2 месяца назад +15

    We use a deque to maintain the k elements and find maximums easily.
    When we find an element in the array greater than the top element, we remove lower elements from the deque since the max is changing.
    We continue this until we find a bigger element in the deque than the current element in the array.
    When i > k - 1, we add the answer because our window is at least k elements wide.
    We also maintain the correct size by checking i - k

  • @sohaildarwajkar9979
    @sohaildarwajkar9979 Месяц назад +4

    I dont comment usually but i would suggest to look the same que from his old playlist. He has explained better there.

  • @AtharvaRao0104
    @AtharvaRao0104 2 месяца назад +12

    some unimportant info:
    deque is pronounced as “deck.” for eg: deck of cards .. it is short form of double-ended-queue .. anyway concept is important not names

  • @SurajKumar-ku1lg
    @SurajKumar-ku1lg 3 месяца назад +3

    best video on sliding window maximum problem

  • @studystuff51
    @studystuff51 2 месяца назад +4

    Bhaiya, after seeing you solve the example, without even seeing you write the pseudo code I was able to solve the question by myself. Thing is, I am not able to think of the approach till you solved the example. I don't know how to come up with the approach myself.

  • @himalayadebbarma-we4pt
    @himalayadebbarma-we4pt 2 месяца назад +1

    Thanks Striver

  • @barathkumar3583
    @barathkumar3583 Месяц назад

    His previous video on same topic explains same concept very detaily

  • @tazanteflight8670
    @tazanteflight8670 Месяц назад +1

    thanks for showing a unsorted data version. Data is never sorted!

  • @TOI-700
    @TOI-700 13 дней назад

    GOT YOU BOTHER RAJ

  • @oyeesharme
    @oyeesharme 17 дней назад

    thanks bhaiya

  • @sanketatmaram
    @sanketatmaram Месяц назад

    understood!

  • @DeadPoolx1712
    @DeadPoolx1712 25 дней назад

    UNDERSTOOD;

  • @sanchitdeepsingh9663
    @sanchitdeepsingh9663 3 месяца назад

    thanks sir

  • @piyushsinghdtu456
    @piyushsinghdtu456 Месяц назад

    understood

  • @KartikeyTT
    @KartikeyTT 3 месяца назад

    tysm sir

  • @TOI-700
    @TOI-700 13 дней назад

    SANK YOU, THANK YOU

  • @tnfdigen1350
    @tnfdigen1350 3 месяца назад

    Bhya ❤👍👍

  • @TOI-700
    @TOI-700 13 дней назад

    understooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooood !?!?!! IDK

  • @subhasrisb11tha28
    @subhasrisb11tha28 28 дней назад

    😄

  • @zaffarzeshan1308
    @zaffarzeshan1308 3 месяца назад +29

    striver not teaching well as compare with old video only expression giving

    • @rishabhkansal5811
      @rishabhkansal5811 3 месяца назад +2

      Yes, I also felt the same. He is not teaching in this playlist like earlier all playlist

    • @Ayush37262
      @Ayush37262 2 месяца назад +4

      I agreed. This Stack and Queue playlist is bad tbh.
      Bhai ek toh dono data structures ko ek hi playlist mein kyu add kar diya 🤦‍♂️

    • @crazymemes4080
      @crazymemes4080 2 месяца назад

      Felt the same, i am going back and checking his old video:)

    • @Ayush37262
      @Ayush37262 2 месяца назад +2

      Bhai course launch karne ke baad mindset pura badal jaata hai...

    • @vinamrasangal8436
      @vinamrasangal8436 2 месяца назад

      @@Ayush37262 right

  • @codmobile1866
    @codmobile1866 3 месяца назад

    first

  • @WebSurfingIsMyPastime
    @WebSurfingIsMyPastime 3 месяца назад +3

    Good post, slow down the releases and you’ll get more views. Nobody can handle viewing and reviewing and learning 3-4 leetcode problems a day. Maybe a speed of one every few days is better

    • @brainmosquito7
      @brainmosquito7 3 месяца назад +23

      apni suggestion apne paas rkh

    • @sarveshkulkarni6287
      @sarveshkulkarni6287 3 месяца назад +4

      That's personal issue, he's already working in a company so as per his valuable time he uploads video's just for us,insteading of asking him for slow releases you yourself can manage your time as you are in need not him.

    • @WebSurfingIsMyPastime
      @WebSurfingIsMyPastime 3 месяца назад +1

      @@sarveshkulkarni6287 Of course I can manage my time. My suggestion is not for me, but for his channel. Most people will skip multiple videos if the speed of delivery is too fast. So (for his channel and engagement) I made the suggestion that he should slow the release, that way he will get more clicks.
      Monetizing youtube videos is not as simple as one would think. You only make money on the views during the first few days of the videos release. If he releases multiple videos and the majority of the engagement/views are not immediate, he will not get much money from releasing this content.

    • @anishsood3084
      @anishsood3084 3 месяца назад

      @@WebSurfingIsMyPastime bro jisne padna vo channel search kr ke pad lega.

    • @gnanyadapa9666
      @gnanyadapa9666 3 месяца назад +1

      ​@@WebSurfingIsMyPastimeWhy are you considering that only first few days would account for the views? Think about the long run mate.

  • @shashankvashishtha4454
    @shashankvashishtha4454 3 месяца назад

    understood