JavaScript Sliding Window Technique - Fixed Size

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 86

  • @TheCodeCreative
    @TheCodeCreative  4 роки тому

    To subscribe to the channel: ua-cam.com/channels/mOpHGj4JRWCdXhllVTZCVw.html

    • @handsanitizer2457
      @handsanitizer2457 4 роки тому +1

      Just found you, this is 👍 thanks for the video

    • @TheCodeCreative
      @TheCodeCreative  4 роки тому

      @@handsanitizer2457 Great, thanks for watching!

  • @anujamestry9235
    @anujamestry9235 День тому

    Best explanation than any other resource. I hope I get sliding window problems in my interviews. Big thanks!!

  • @paschalynukwuani6930
    @paschalynukwuani6930 2 роки тому +6

    This is undoubtedly the best explanation for a tutorial on algorithms I have seen on UA-cam. I look forward to receiving more notifications to watch more tutorials from this channel. You are amazing with your way of explanation. Thank you!

  • @batmunkhn6666
    @batmunkhn6666 2 роки тому +1

    this is the best way someone explained the technique and the actual code

  • @okonkwo.ify18
    @okonkwo.ify18 3 роки тому +1

    Videos are better for learning than reading online. I have read and read about this and couldn’t understand anything. But your video makes it clear to me

  • @tripl9111
    @tripl9111 3 роки тому +2

    wow! This is the best video on the sliding window pattern. Your explanation is top notch and animations and audio quality are outstanding. Please do more videos on other patterns like Two Pointers and Fast and Slow pointers. Keep up the great work!

  • @yokohibarashi1386
    @yokohibarashi1386 4 роки тому +1

    Your voice and the calm clear explanation really helped me understand this technique. Subscribed and liked!

    • @TheCodeCreative
      @TheCodeCreative  4 роки тому

      That's great to hear! Thanks for watching 👍🏻

  • @dheerajnaik6467
    @dheerajnaik6467 4 роки тому +3

    Hi sir .. these algorithms and the way you explain them are amazing . please don't stop .. these are the best in youtube.

    • @TheCodeCreative
      @TheCodeCreative  4 роки тому

      Hi Dheeraj, thanks for the kind words. More videos coming soon. Thanks for watching!

  • @ryanbollettino8983
    @ryanbollettino8983 2 роки тому +1

    Thank you for this. Been struggling to grasp the concept of coding it.
    The "aha" was when I realized that [i] will ALWAYS be bigger than [size -1] once you have your first "true" sum of numbers.
    Subscribed and watching. Thanks again!

  • @starvisor751
    @starvisor751 3 роки тому +1

    You explained this so eloquently and now I have a clear understanding of this method. Thank you.

  • @CakeBossan
    @CakeBossan 10 місяців тому

    the brute force approach is not quadratic, but it is O(nm), where m is the fixed window size and n is the number of elements in the array. If you assume that m

    • @CakeBossan
      @CakeBossan 10 місяців тому

      even when m is close to n, it is not quadratic as the number of iterations drops significantly, so it is closer to linear time.

  • @losbur5416
    @losbur5416 4 роки тому +1

    The way you explain this algorithm is just incredible

  • @johnnewman8865
    @johnnewman8865 10 місяців тому +2

    I've researched good explanation for this technique. Your version is the best. Thanks for your videos.

  • @todaysmotivation9692
    @todaysmotivation9692 3 роки тому +1

    The video presentation and transition of the window over array and you method was awsome

  • @Human_Evolution-
    @Human_Evolution- 3 роки тому +1

    love the MDN screenshots and the voice is great. Subbed.

  • @aysesinanmuslu7409
    @aysesinanmuslu7409 4 роки тому +1

    I loled at 4:05 Nice videos!

  • @aslan6921
    @aslan6921 Рік тому +1

    Best algorithm explanation that i ever found!

  • @prasannakumari1597
    @prasannakumari1597 Рік тому +1

    Excellent Explanation Sir. Thank you very much.

  • @wabbit2158
    @wabbit2158 2 роки тому +1

    golden content, needs to be at 1 million+ views really...

  • @gboyegalawal8881
    @gboyegalawal8881 2 роки тому +1

    This is really helpful. Thank you

  • @subhashgn1775
    @subhashgn1775 3 роки тому +1

    Enjoyed your teaching.
    Very grateful to you man...

  • @JaBoss397
    @JaBoss397 2 роки тому +1

    THANK YOU KEEP UP GOOD WORK I WAS STRUGGLING WITH SLIDING WINDOWS. Do you have a dynamic sliding window video ????

    • @TheCodeCreative
      @TheCodeCreative  2 роки тому

      Thanks! No dynamic sliding window yet, but stay tuned!

  • @dumtoimoh2840
    @dumtoimoh2840 Рік тому +1

    first time i saw sliding window it looked like a hard code to understand, but bro you just demystified it

  • @DharmikGohil-bw2ug
    @DharmikGohil-bw2ug 3 роки тому +1

    keep it up 👌👌👌 great videos with great values thanks i hope your channel grow fast

  • @alexandernemechek3494
    @alexandernemechek3494 3 роки тому +1

    Excellent video!

  • @nemanjam6272
    @nemanjam6272 Рік тому +1

    You the man. Thank you

  • @oaklandathleticfan12
    @oaklandathleticfan12 7 місяців тому +1

    Amazing video, thank you

  • @showwong4466
    @showwong4466 3 роки тому +1

    Excellent explanation! Thank you.

  • @vinothkannans1910
    @vinothkannans1910 4 роки тому +1

    Great explanation with Clarity 👍

  • @muriukialex
    @muriukialex 2 роки тому +1

    Thank you mate!

  • @LazyShady
    @LazyShady 2 роки тому +1

    Good explaination.

  • @jamjam3448
    @jamjam3448 3 роки тому +2

    Wowww. Thanks a million 😁 😁 😁

  • @Eeezus1914
    @Eeezus1914 3 роки тому +1

    great explanation

  • @arunkaiser
    @arunkaiser 4 роки тому +1

    Awesome Greg 👍🏽👍🏽👍🏽

  • @oluwatobioyewole1501
    @oluwatobioyewole1501 3 роки тому

    Hi, thanks so much for the clear explanation found it very insightful.
    I would like to know other algorithmic techniques one should know because this is my first time hearing about this concept. Hence, am very curious about other concepts like the sliding window technique

  • @zameeebasha
    @zameeebasha 4 роки тому +1

    Awesome!

  • @linas3075
    @linas3075 2 роки тому

    First of all, thank you for the tutorial! It's very well-paced and easy to follow.
    However, I have a question regarding subtracting the number once i gets to >= size. On line 9, we do this:
    `currSum -= nums[i - (size-1)];`
    Is it correct, though? Let's say, our i is 3, which means that we have to "move" the window, remove the first element and start calculating from the second element in the array. In that case, we should subtract nums[0], which is nums[i - size] (= nums[3-3]). If we subtract nums[3 - (3-1)], we end up subtracting nums[1], which is incorrect, isn't it?

  • @TheCodeCreative
    @TheCodeCreative  3 роки тому

    📖 Download my FREE "Google Search Secrets for Developers" Cheat Sheet:
    store.thecodecreative.com/google-secrets-cheat-sheet

  • @TheCodeCreative
    @TheCodeCreative  4 роки тому

    🗣JOIN the Code Creative Facebook group! :
    facebook.com/groups/1612600368887577

  • @patrickchan2503
    @patrickchan2503 3 роки тому

    thanks for this, would be good to do a nested for loop so we could compare it with the optimised solution, just a thought, thanks.

  • @cvain07
    @cvain07 3 роки тому +1

    please bring a dsa algoritm interview prep series in js

  • @cmdv42
    @cmdv42 2 роки тому +1

    💯✨

  • @potterfreak63
    @potterfreak63 3 роки тому +1

    anyone else here for advent of code?

  • @_slier
    @_slier 3 роки тому +1

    i guess the cat have a hard time understanding the sliding window algos.

  • @aryanisml
    @aryanisml Рік тому +1

    Good Explanation

  • @greggfineguitar
    @greggfineguitar 4 роки тому

    🗣JOIN the Code Creative Facebook group! :
    facebook.com/groups/1612600368887577