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.
@@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!
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.
Bhaiya for numbers which are primes like 1e9+7 or numbers which are not perfect squared like 3^9 will this method work?
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.
Got it bhaiya.Thanks for replying🙂.
@@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!
Kya bawal chiz bana diye ho. Maza agaya
Thanks, I wanted an implementation of square root decomposition for a long time.
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.
Hello bro your explanations are really great ( probably finest in all of youtube ) please make vedioes on segment trees and Fenwick trees also.
Bhai mauj kardi. Tum toh bade heavy explainer ho bhai
bhai you are amazing.keep doing this for us please
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 🎉🎉🎉.
Frequency might be low but I'll keep posting useful content and trying my best to add value :)
@@AlgosWithKartik that's all we need. Thanks a lot bhaiya.
Thanks for the videos :)
Please continue for segment and fenwick trees🙌
Very important concept kartik bhaiya ❤️
with too many applications *
Lovely explanation!
what an explanation. amazing
What about Mo's algorithm?
precise
thank you bhaiya
Sir please start graph series
Bhaiya expected value part 2 kab aayegi?
Abhi bandwidth kam h and time milne prr focussing on range query series. Will try ki expected value bhi jaldi continue krru :)
@@AlgosWithKartik Okay. I have been binge watching your videos. Gem content.
bawaal ekdum