#include<bits/stdc++.h>using namespace std;void BulidTree(int * arr,int start,int end,int i,int * tree){ if(start==end) { tree[i]=arr[start]; return; } int…
Segment-Tree
1 Article
#include<bits/stdc++.h>using namespace std;void BulidTree(int * arr,int start,int end,int i,int * tree){ if(start==end) { tree[i]=arr[start]; return; } int…