A comprehensive introduction to Segment Tree

# 1. What is a Segment Tree?

Let’s say we have an array** A** of size **N**. A **segment** of the array is a contiguous part of an array in form **A[i : j]** such that **0 ≤ i ≤ j ≤ N-1**.

A **segment tree** is essentially a binary tree…