Easily Solve Range Query Interview Problems with Square Root Decomposition/Mo's Algorithm

  Рет қаралды 10,908

Kunal Kushwaha

Kunal Kushwaha

Күн бұрын

In this tutorial, we'll explore the Square Root Decomposition method, a powerful algorithm for tackling range query problems in coding interviews. Join me as we break down the concept and demonstrate its application in solving real-world coding challenges.
Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!
👉 Resources
- Join Replit: join.replit.com/kunal-kushwaha
- Lecture code: replit.com/@KunalsReplit/SQRT...
- Complete Java DSA playlist: • Java + DSA + Interview...
- Code, Assignments, & Notes: github.com/kunal-kushwaha/DSA...
➡️ Connect with me: kunalkushwaha.com
👨‍💻 Join WeMakeDevs: wemakedevs.org
=============================================
Timestamps:
00:00 Theory
28:59 Code
#dsa #placement

Пікірлер: 46
@KunalKushwaha
@KunalKushwaha 6 ай бұрын
👉 Resources - Join Replit: join.replit.com/kunal-kushwaha - Lecture code: replit.com/@KunalsReplit/SQRTDecomposition
@magicdoor5802
@magicdoor5802 6 ай бұрын
Bro please give a lecture on dynamic programming and one video on dynamic programming questions that will be best please do it. i know you must be busy but please consider this request .
@orion3052
@orion3052 5 ай бұрын
Never seen anyone teaching something wrong with so much confidence xD He genuinely believes what he is teaching is actually MO
@girishn804
@girishn804 6 ай бұрын
Thank you Kunal..!! Please try to bring back the OG notepad which you used in the previous videos :)
@pavan305
@pavan305 6 ай бұрын
You look so tired brother.. that doesn't seem good have some sleep first 🙌
@user-jb6ey8wn4i
@user-jb6ey8wn4i 6 ай бұрын
Welcome back to india Kunal. Back to old set up looks so satisfying.
@sasankmathur6736
@sasankmathur6736 6 ай бұрын
We can also use the two pointer method as well better than o(n).
@NareshNaresh-cl8rn
@NareshNaresh-cl8rn Ай бұрын
Sir i am thankful for dsa playlist please complete the course sir
@swatisharma3425
@swatisharma3425 6 ай бұрын
Hello Kunal, can you please make some videos on Dynamic Programming. I have covered mostly DSA topics through your DSA Bootcamp and it is very easy to understand any topic from your videos.So it's my request to you please also make some videos on DP.It is the most important topic . I have looked for other resources also but it didn't help me out. You cover important topics very effectively. So please make videos on DP as soon as possible
@jk-sm6qr
@jk-sm6qr 2 ай бұрын
Thank you kunal Need videos on DP and graphs
@simahalder9493
@simahalder9493 6 ай бұрын
Thank you so much bhaiya❤
@santoshis2568
@santoshis2568 6 ай бұрын
Hi Kunal, there is no easy resources for sliding window problems. Can you make some preliminary videos for them? Thanks
@sourabhkumar5815
@sourabhkumar5815 6 ай бұрын
Try Aditya verma's sliding window playlist. He has spoon-fed the concepts.
@AbhishekPandey-cz5kw
@AbhishekPandey-cz5kw 4 ай бұрын
Bhai , Please suggest any full Java Web Development paid/unpaid courses@@sourabhkumar5815
@MonuKumar-pe7oq
@MonuKumar-pe7oq 6 ай бұрын
Thank you @kunal bro..
@rahull1321
@rahull1321 6 ай бұрын
Hey Kunal u haven't taught prims and dijkstra's algorithm
@AbhiishekKumar21
@AbhiishekKumar21 Ай бұрын
Please upload more and more video on DSA
@upsidedown6204
@upsidedown6204 6 ай бұрын
Thank you bhaiya 😊
@Muigoku49
@Muigoku49 6 ай бұрын
Kunal please start graphs and dp
@chikuu6770
@chikuu6770 3 ай бұрын
Great video
@user-ld9qj3il7p
@user-ld9qj3il7p 3 ай бұрын
Please do videos on graphs and dynamic programming. We are eagerly waiting🥺
@upsidedown6204
@upsidedown6204 6 ай бұрын
Cool 😎👍
@muhafizraza755
@muhafizraza755 6 ай бұрын
But if we look at the time to create the BLOCK[ ] array, it's still O(n). Then how the overall time complexity will be SQRT(n) ?
@d4devotion
@d4devotion 6 ай бұрын
Yes even I think so, because even during that preprocessing we have to divide and add numbers, so not sure how is this really gonna reduce to O(square root of N)
@arvindkr8966
@arvindkr8966 5 ай бұрын
coz building the block array always O(n). its the query and update that takes √n.
@arvindkr8966
@arvindkr8966 5 ай бұрын
the aim is to reduce the time complexity of the Query
@sarfrasahamed3322
@sarfrasahamed3322 6 ай бұрын
Complete the DSA bootcamp soon
@subasm2160
@subasm2160 5 ай бұрын
There is a bug in this code it gives out of bound exception for array size like 7,8 and 13,14,15 . The reason is sqrt of (8 and 7) is 2 and we are creating block array of size 2+1 = 3 so it can only store 3*2=6 elements but when the array size is 7 or 8 it gives ArrayIndexOutOfBoundsException and the same goes for 13,14 and 15
@kinandm5301
@kinandm5301 18 күн бұрын
int[] blocks = new int[(n/sqrt)+1]; try this
@rohit8hjj
@rohit8hjj 6 ай бұрын
Any idea of how much time is required to complete the course?
@KaizokuOuNaruto
@KaizokuOuNaruto 6 ай бұрын
LOL.. He is giving it for free so you don't have any right to ask about this Stfu and get lost
@darkKingGaming493
@darkKingGaming493 6 ай бұрын
3,4 months
@HeyMr.OO7
@HeyMr.OO7 6 ай бұрын
December 2023 he replied to my comment earlier in binary search video
@deepanshugarg4446
@deepanshugarg4446 6 ай бұрын
Can you make podcast on flutter
@aravindr9109
@aravindr9109 6 ай бұрын
yeah I would like to hear that
@dark_techyy
@dark_techyy 6 ай бұрын
Dynamic Programming kb aarhi h?
@abhishekc3556
@abhishekc3556 5 ай бұрын
Jab wo khud seekhlega toh le aaega
@Stefan_2117
@Stefan_2117 2 ай бұрын
😂​@@abhishekc3556
@kaustubhgaikwad2562
@kaustubhgaikwad2562 6 ай бұрын
To reach candidate master is java helpful?
@i_am_wiz
@i_am_wiz 5 ай бұрын
You can be Grandmaster using Java, language never mattered, it’s just some incovenience you’ll have to face because of its sluggishness
@user-dt6mx2fw5p
@user-dt6mx2fw5p 5 ай бұрын
This is square root decomposition, not mo's algorithm
@vakeelsaab5323
@vakeelsaab5323 6 ай бұрын
TQ Kunal
@achintya-7
@achintya-7 6 ай бұрын
Finally
@arvindkr8966
@arvindkr8966 5 ай бұрын
the size of the BLOCK array should be (√n +2) instead of (√n+1) as far as Integers are concerned. for the following numbers we will get IndexOu of Bound error if we go with (√n+1) blocks n = 3 8 15 24 35 48 63 80 99 120 143 168 255 288 360 1023 1088 and so on.
@pratyushpahari2606
@pratyushpahari2606 6 ай бұрын
Hope this course will be finished before the year ends 🥹
Recursion - Array Questions (Theory + Code + Tips)
1:18:48
Kunal Kushwaha
Рет қаралды 266 М.
Subsets II - Backtracking - Leetcode 90 - Python
15:05
NeetCode
Рет қаралды 91 М.
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
00:19
Паша Осадчий
Рет қаралды 5 МЛН
Тяжелые будни жены
00:46
К-Media
Рет қаралды 5 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 49 МЛН
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 869 М.
G-41. Bellman Ford Algorithm
27:43
take U forward
Рет қаралды 156 М.
Introduction to HashMap & HashTable in Java
1:39:46
Kunal Kushwaha
Рет қаралды 65 М.
Sqrt(x) - Leetcode 69 - Python
8:34
NeetCodeIO
Рет қаралды 42 М.
Linked List Interview Questions - Google, Facebook, Amazon, Microsoft
3:08:11
Introduction to Jupyter Notebooks with Database Integration
20:09
Kunal Kushwaha
Рет қаралды 7 М.
Why I Moved Abroad for My Job
11:57
Kunal Kushwaha
Рет қаралды 50 М.
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 10 МЛН
Дени против умной колонки😁
0:40
Deni & Mani
Рет қаралды 9 МЛН
How much charging is in your phone right now? 📱➡️ 🔋VS 🪫
0:11
С Какой Высоты Разобьётся NOKIA3310 ?!😳
0:43