Square Root Decomposition with Code

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

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

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

    Bhaiya for numbers which are primes like 1e9+7 or numbers which are not perfect squared like 3^9 will this method work?

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

      Yes it will.
      Imagine N the size of array is not a perfect square.
      There are two things you can do:
      1. Add some extra elements to the array (equal to identity element, 0 incase of sum queries) to make the size a perfect square.
      2. Make ceil(root(N)) chunks with each chunk having exactly ceil(root(N)) elements except for the last chunk which will have fewer elements and it's okay.

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

      Got it bhaiya.Thanks for replying🙂.

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

      @@AlgosWithKartik Hello. How hard is it to get an internship for a big company while being at university? Ty!
      edit: And if you know, can you give me some advice about it? What to work on, what types of problems should i solve, any advice would be great!

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

    Kya bawal chiz bana diye ho. Maza agaya

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

    Thanks, I wanted an implementation of square root decomposition for a long time.

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

    The best explanation, i love your teaching bro . Please do make videos on problem solving using these methods it will give us much better understanding.

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

    Hello bro your explanations are really great ( probably finest in all of youtube ) please make vedioes on segment trees and Fenwick trees also.

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

    Bhai mauj kardi. Tum toh bade heavy explainer ho bhai

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

    bhai you are amazing.keep doing this for us please

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

    It really feels bad to see that the frequency of video uploads has reduced. But its understandable you have to work life too. Thanks a lot though 🎉🎉🎉.

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

      Frequency might be low but I'll keep posting useful content and trying my best to add value :)

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

      @@AlgosWithKartik that's all we need. Thanks a lot bhaiya.

  • @AyushGupta-mm4jg
    @AyushGupta-mm4jg 3 ปีที่แล้ว +2

    Thanks for the videos :)

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

    Please continue for segment and fenwick trees🙌

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

    Very important concept kartik bhaiya ❤️

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

    Lovely explanation!

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

    what an explanation. amazing

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

    What about Mo's algorithm?

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

    precise

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

    thank you bhaiya

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

    Sir please start graph series

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

    Bhaiya expected value part 2 kab aayegi?

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

      Abhi bandwidth kam h and time milne prr focussing on range query series. Will try ki expected value bhi jaldi continue krru :)

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

      @@AlgosWithKartik Okay. I have been binge watching your videos. Gem content.

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

    bawaal ekdum