Can you please tell me why the code is giving segmentation fault
Problem in the code
u need to make a segment tree of size
int
mx = *max_element(arr, arr + n);
// Segment Tree
int
Tree[6 * mx];
I`ll let u know the segment tree code i see if i am giving sample input from test files its giving segment error even in gfg
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.