Slicing problem solved.

The "compose" data member in SegmentTree class has been changed to be of pointer type to avoid the slicing problem.
To know more about SLICING in C++, visit http://stackoverflow.com/questions/274626/what-is-the-slicing-problem-in-c
Added some spaces.