Link to webpage: https://www.srcmake.com/home/segment-tree
Link to github: https://github.com/srcmake/segment-tree
Segment Trees are an advanced data structure used to represent arrays. They're specialty is searching for ranges in an array. For example "finding the minimum from index L to index R" is a query that a segment tree would be able to solve in O(log N) time.
In this video, we'll go through some pseudocode for how segment trees work, and we'll draw out actual diagrams explaining how to build, query, and update segment trees. We'll also look through some working C++ code I've written for how to implement a segment tree in a program.
We can also use segment trees to find the maximum and sums of ranges.
Twitter: https://twitter.com/srcmake
Twitch: https://www.twitch.tv/srcmake
Discord: https://discord.gg/q5vAET3