Function to construct segment tree from given array . This function allocates memory for segment tree and calls constructSTUtil ( ) to fill the allocated memory
int * constructST ( int arr [ ] , int n ) {