However, this approach can be further improved. It is also guaranteed that in the range between the former maximum and the just found current maximum no value is greater than the former maximum. Therefore, it is also wastage of time to look for a value greater than the former maximum in this range. Then, in the next iteration it is safe for to look for the maximum from the location of the current maximum and can put the former maximum element at the location just before the current maximum value by interchanging appropriately to minimize the search space.