Sparse Table Data Structure

  Рет қаралды 32,768

WilliamFiset

WilliamFiset

Күн бұрын

Пікірлер: 54
@thunderbolt8632
@thunderbolt8632 4 жыл бұрын
William tu to devta nikla re! Awesome 🔥
@alex85354
@alex85354 3 жыл бұрын
Shoutout to William and folks who contributed to this fantastic video. That being said, it's really a bummer that we're missing a video about a segment tree. Fenwick tree and Sparse table have its own advantages to select as primary datastructures, but when you need a point update for RMQ, then we definitely need to turn our heads to a segment tree :( The fact that other online sources aren't as easy to consume knowledge as your video, it would be much appreciated if you could make one in future!
@madhukiranattivilli2321
@madhukiranattivilli2321 3 жыл бұрын
What's RMQ? Range Min Query (or Range Max Query)? William Fiset says Fenwick Tree Point Update runs in O(log2(n)). Not good enough? Does a Segment Tree runs faster than this? I'm yet to learn about Segment Trees Please reply
@daumtto
@daumtto Жыл бұрын
Thank you william from South Korea!! Please do not remove these awsome videos. It really helped me a lot and helping me now. You make complicated things easy. I thank you again.!!
@ankitsinha9019
@ankitsinha9019 4 жыл бұрын
In first 2-3 minute u realize ur at right place for ur concept... awesome video:)
@dotproduct763
@dotproduct763 4 жыл бұрын
Amazing explanation! I'm finally at peace with this concept 👌
@jaatharsh
@jaatharsh 4 жыл бұрын
WOAH this is really awesome, I appreciate the hard work put behind creating such top-notch quality content. your explanation is amazing William, please do keep posting such video's.
@joydeepbhattacharjee3849
@joydeepbhattacharjee3849 4 жыл бұрын
at 13:03 the equation of len should be len = r - l + 1 since r > l.
@isaiasramirez7071
@isaiasramirez7071 4 жыл бұрын
This is pure gold William, thank you for such a great content. I've been struggling with an advanced problem in Hackerrank and your video series about trees just pointed me to the right direction. :D
@arsilvyfish11
@arsilvyfish11 2 жыл бұрын
Amazing explanantion, was really helpful, thank you to William and the other collaborators!
@youngjim7987
@youngjim7987 2 жыл бұрын
amazing presentation. I prefer first to watch some videos like these to grip the high-level idea and read the book to dive deeper.
@JWong-hh5sr
@JWong-hh5sr 4 жыл бұрын
Great video! Very clear and concise!
@flyingtiger123
@flyingtiger123 8 ай бұрын
Fantastic video, concept well explained🎉🎉
@jeevan999able
@jeevan999able 3 жыл бұрын
Thank you for the great explaination
@ShreyasNimishe
@ShreyasNimishe 4 жыл бұрын
very clear and concise!
@lucien5112
@lucien5112 2 жыл бұрын
19:35 What happens with i is odd, and i/2 is a non-integer index of array log2
@張機智
@張機智 3 жыл бұрын
Thank you for the explanation
@BerArchegas
@BerArchegas 3 жыл бұрын
Amazing video
@uchennanwanyanwu2777
@uchennanwanyanwu2777 4 жыл бұрын
Thanks for the video. Finally, there's a good tutorial on Sparse tables. In your opinion, would you choose Sparse table over Segment trees
@WilliamFiset-videos
@WilliamFiset-videos 4 жыл бұрын
It depends. Sparse tables are great for fast range queries (although you do need nlogn memory). However, as soon as you need to be able to do any kind of point update or range update a segment tree is a good choice.
@arthurtapper1092
@arthurtapper1092 3 жыл бұрын
You should really bring the volume for your voice up, either via directly speaking to microphone louder or post processing as I have you turned up to 100% and if the room isn't completely quiet I cant hear you. If i play a song off of youtube at 5% it drowns you out even when your at 100% . Other than that great videos!
@l3zhang392
@l3zhang392 2 жыл бұрын
at 12:58, it should be len = R - L + 1 = 11 - 1 + 1, or?
@mohitjaiswal5113
@mohitjaiswal5113 4 жыл бұрын
ThankYou so much for this !!
@shameekagarwal4872
@shameekagarwal4872 4 жыл бұрын
why will i want to use a sparse table for functions without good overlap?? i can use segment tree...
@mohammadyahya78
@mohammadyahya78 2 жыл бұрын
Thank you William. How did you compute last row at 16:00 please? I see that first element should be 2*-6*-6= -12*-6 = 72, but you wrote -12, why?
@WilliamFiset-videos
@WilliamFiset-videos 2 жыл бұрын
I computed -12 from the row above it from the cells at (row 1, col 0) and (row 1 col 2) for 2 * -6 = -12.
@ShubhamJoshishubhamjoshi
@ShubhamJoshishubhamjoshi 4 жыл бұрын
Great explanation William . Can you post some videos on string matching algorithms also.
@bismeetsingh352
@bismeetsingh352 4 жыл бұрын
Didnt understand how the table was constructed at 9:27
@sahilguleria5505
@sahilguleria5505 4 жыл бұрын
In CascadingMinQuery(), for product example where we have to find product of all elements between [0,6]. In first iteration of for loop we will have [0, 0 + 2^2) in next iteration it will be [4, 4 + 2^2) which should be [4, 4 + 2^1) as discussed in product range query example. We will not be having the t[2][4] in sparse table. Then how to check that in the function
@WilliamFiset-videos
@WilliamFiset-videos 4 жыл бұрын
Notice that the cascading query function starts with the largest interval which is a power of 2.
@sahilguleria5505
@sahilguleria5505 4 жыл бұрын
Got it my bad
@shikharsaxena9989
@shikharsaxena9989 4 жыл бұрын
why i+(1
@HelloWorld-tn1tl
@HelloWorld-tn1tl 3 жыл бұрын
So, the time complexity is O(log(n)), and space complexity is O(n*log(n)) ?
@ilyam1425
@ilyam1425 5 ай бұрын
may be im stupid, but im not quite understand the idea. white, blue, intervals, subintervals. feels like author explain it to himself. not all people understand this, if they not reading Knuth
@ankitchoudhary197
@ankitchoudhary197 8 ай бұрын
wonderful
@boomboom-9451
@boomboom-9451 Жыл бұрын
Why not using idempotency instead of overlap friendly term
@mersenne2486
@mersenne2486 9 ай бұрын
not everyone is a boomer like you
@netional5154
@netional5154 4 жыл бұрын
Thanks for the great video. At 15:25 the last segment goes to 16. I think it's an error.
@WilliamFiset-videos
@WilliamFiset-videos 4 жыл бұрын
Hi Netional, I think 15:25 is ok. I'm using the "half closed interval" notation [a, b) where a is inclusive, but b is not. Maybe I should have been more clear about that. As an example, the interval [3, 6) would mean {3, 4, 5}, not {3, 4, 5, 6}, and [4, 5) would just be: {4}
@netional5154
@netional5154 4 жыл бұрын
@@WilliamFiset-videos ah, I understand.
@HimanshuDagar-kr7ct
@HimanshuDagar-kr7ct Жыл бұрын
Just Wow!
@naviesometimes9417
@naviesometimes9417 4 жыл бұрын
It's very helpful
@sourav_ghosh
@sourav_ghosh 4 жыл бұрын
What if the array is not static? Can we use sparse table?
@sivaramd5637
@sivaramd5637 4 жыл бұрын
No, If the array is not static we need to update the sparse table which will take O(NlogN) time so, instead, you can use Fenwick tree or Segment tree (which takes only O(logN) time)
@prasannathapa1024
@prasannathapa1024 4 жыл бұрын
this is the best
@mersenne2486
@mersenne2486 9 ай бұрын
awesome
@algorithmimplementer415
@algorithmimplementer415 4 жыл бұрын
Volume is very low!
@fdshdsfdsqq
@fdshdsfdsqq Жыл бұрын
ty!
@vaibhavkumar6796
@vaibhavkumar6796 2 жыл бұрын
Dude the volume is so low
@abhigupta6681
@abhigupta6681 4 жыл бұрын
Thanks for the tutorial. Can you please make video on lca queries as well?
@AyzenVN
@AyzenVN 22 күн бұрын
bro you saved my life :LOL:
@surajkulriya8536
@surajkulriya8536 4 жыл бұрын
great
Sparse Table Data Structure | Source Code
7:16
WilliamFiset
Рет қаралды 6 М.
Sparse Table & RMQ (Range Minimum Query)
18:42
Errichto Algorithms
Рет қаралды 80 М.
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Lowest Common Ancestor (LCA) Problem | Eulerian path method
17:02
WilliamFiset
Рет қаралды 46 М.
Indexed Priority Queue (UPDATED) | Data Structures
25:22
WilliamFiset
Рет қаралды 26 М.
Tiling problems [1/2] | Dynamic Programming
16:38
WilliamFiset
Рет қаралды 40 М.
What P vs NP is actually about
17:58
Polylog
Рет қаралды 144 М.
10 Key Data Structures We Use Every Day
8:43
ByteByteGo
Рет қаралды 366 М.
Sparse Table | Range Minimum Query in O(1)
17:13
Kartik Arora
Рет қаралды 8 М.
Towers of Hanoi: A Complete Recursive Visualization
21:13
Reducible
Рет қаралды 505 М.
Hash table hash function
17:21
WilliamFiset
Рет қаралды 44 М.
Fenwick Tree range queries
13:45
WilliamFiset
Рет қаралды 38 М.