Segment Trees Explained and C++ Code

Published: 15 September 2019
on channel: srcmake
1,813
28

Link to webpage: https://www.srcmake.com/home/segment-...
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:   / srcmake  
Twitch:   / srcmake  
Discord:   / discord  


On this page of the site you can watch the video online Segment Trees Explained and C++ Code with a duration of hours minute second in good quality, which was uploaded by the user srcmake 15 September 2019, share the link with friends and acquaintances, this video has already been watched 1,813 times on youtube and it was liked by 28 viewers. Enjoy your viewing!