Skip to main content

Command Palette

Search for a command to run...

Segment Tree for Competitive Programming

What is Segment Tree? Why we use it? When we should use it? How to implement it?

Published
1 min readView as Markdown
A

Software Developer @uSthaan Ex- @Amazon, @CodingNinjas, @Leetcode, @Zuno, @Blackbird, @Lyft, Quantium, Shiga. Expert in Codeforces, 5* Leetcode, Knight @Leetcode

What is a Segment Tree?
The answer is, Segment Tree is nothing but it's like a Binary Tree, which is used to store information regarding some intervals, and each node in the tree represents some information regarding the intervals.