Simplest Explanation of Square Root Decomposition | Developing Intuition

Sdílet
Vložit
  • čas přidán 5. 01. 2024
  • If this video gets 500 likes or 100 comments, I will record a video talking about different variations and example problems of the technique explained in the video.
    If you found this useful, like and comment on the video, that is very encouraging for me to make more such educational videos.
    Subscribe for more such content.
    Problem to try to test your implementation - cses.fi/problemset/task/1648
    Code for the problem explained for the curious ones (I will strongly advise to first try writing yourself, it's not long but a tricky implementation) - github.com/Abhishek-Saini/edu...
    I will add more harder problems here later.
    Mouse I use - shorturl.at/hloAX
    Keyboard I use - shorturl.at/elFHX
    Microphone I use - shorturl.at/hpT13

Komentáře • 35

  • @dotnlast5984
    @dotnlast5984 Před měsícem

    The second query - changing a value should really be constant time by the SQRD. You can get the block from the index of the element you want to change by constant time. Then you just add the difference of the new and old element (being careful ofc) to the already cached sum of that block. So it’s really constant time.

  • @anirudhgarg4753
    @anirudhgarg4753 Před 5 měsíci +2

    Thanks for explaining this. Would be very helpful if you can discuss problems regarding this concept.

  • @mdaasil2329
    @mdaasil2329 Před 4 měsíci

    Amazingly explained bro. Keep doing more

  • @subhamcoder
    @subhamcoder Před 5 měsíci +2

    Sir more videos please

  • @Dontpushyour_luck
    @Dontpushyour_luck Před 5 měsíci

    Nice explanation. Would love to see more videos on this technique application, and maybe some questions solving in the video itself. Also would like to see videos on advanced topics like this from your side

  • @BhagyaRana
    @BhagyaRana Před 5 měsíci

    Awesome Content Abhishek Sir! 🔥👌🏻

  • @dhruvsolanki4473
    @dhruvsolanki4473 Před 5 měsíci +1

    Good explanation.

  • @AniketPandey-nr5ti
    @AniketPandey-nr5ti Před 5 měsíci +1

    Great explaination. Explained the concept really well. It would really be helpfull if you could follow this up with some set of questions that show how to apply this in various cases.

  • @DebopriyoBasu
    @DebopriyoBasu Před 5 měsíci +1

    Thank you for the simple explanation😊

  • @Sachin-qn1wf
    @Sachin-qn1wf Před 5 měsíci +4

    Cool explanation ✨✨

  • @devanshupadhyay2658
    @devanshupadhyay2658 Před 5 měsíci

    Loved the Explanation !!

  • @shivrajbhosale6682
    @shivrajbhosale6682 Před 5 měsíci

    Explained well

  • @dineshchintu9779
    @dineshchintu9779 Před 5 měsíci

    Great video.

  • @sineanima4596
    @sineanima4596 Před 4 měsíci

    amazing content sir

  • @loudcapricorn5513
    @loudcapricorn5513 Před 5 měsíci

    Helpful.Thanks for the video

  • @nikhilsihare1887
    @nikhilsihare1887 Před 5 měsíci

    Very good explanation ❤

  • @shashanktiwari4442
    @shashanktiwari4442 Před 5 měsíci

    Nicely explained.. pls make video on problems which can be solved with these

  • @devanshupadhyay2658
    @devanshupadhyay2658 Před 5 měsíci

    Yes Please bring a video on problems based on SRD

  • @teddybear5828
    @teddybear5828 Před 5 měsíci +1

    Great explanation, you delivered as you had promised. I have a doubt tough, while solving problems, can't we use segment trees to perform the task of updates and queries? Segment trees can do them in O(logn), then why square root decomposition for it? Just for better memory optimization or something else?
    P.S. do make more videos continuing this topic, along with its implementation and use in problem solving.

  • @uditmehta5719
    @uditmehta5719 Před 5 měsíci

    Nice👍

  • @Munnu-hs6rk
    @Munnu-hs6rk Před 5 měsíci

    good explanation! but i think you should also show some glance of implementation quickly to end .

    • @abhishekcode42
      @abhishekcode42  Před 5 měsíci

      Sure, will try to do that whenever needed. Generally I am thinking of focussing on making algorithm understand, as once one understand that it's easier to get the code just by reading. Perhaps will try to show implementation for the harder ones.
      For this problem you can find the code here on my github github.com/Abhishek-Saini/educational/blob/main/youtube/square_root_decomposition_explanation_problem.cpp

  • @Bharat_Rider
    @Bharat_Rider Před 5 měsíci

    Thank you sir ❤❤

  • @kaushiksen2190
    @kaushiksen2190 Před 5 měsíci

    Please explain solutions for contest problems. Thanks alot for your videos.

  • @raghuvanshsiddharth9048
    @raghuvanshsiddharth9048 Před 5 měsíci

    Problems with all variations really needed🥲

  • @akashdebnath1142
    @akashdebnath1142 Před 5 měsíci +1

    Sir can you refer some resources for web development where should we learn those.

  • @kuldeepparmar3641
    @kuldeepparmar3641 Před 5 měsíci

    ❤❤

  • @idk._.69.
    @idk._.69. Před 5 měsíci

    nice

  • @AmitKumar-jm5zm
    @AmitKumar-jm5zm Před 5 měsíci +1

    Bhaiya ajj leetcode context ka question 3,4 ka ek bana do please 🥺 .

  • @ramanujaamit
    @ramanujaamit Před 5 měsíci

    Great idea!!
    But this problem can be easily solved using segment trees.
    Can you please give a question link where this technique can be handy (I mean which cannot be solved using segment trees or any other known easy algorithms)?

    • @abhishekcode42
      @abhishekcode42  Před 5 měsíci +1

      You can try this atcoder.jp/contests/abc335/tasks/abc335_f
      Problem picked is intentionally simpler so that folks can develop intuition better. There are many problems where some sort of square root decomposition idea is used.

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

      yep, using Fenwick tree complexity can be q*log(n)

  • @umitsahoo5180
    @umitsahoo5180 Před 5 měsíci

    Bro pulled me with his ratting 😅

  • @sachinpateltech
    @sachinpateltech Před 5 měsíci

    OPOPOP