I am currently using segment tree to find out the smallest and largest number in a range in an unsorted array by comparing and storing the smallest and largest of sub-arrays.
However, I am getting confused on what information needs to be saved while finding two smallest numbers and one largest number in a range in an unsorted array.