Hey @harsh.hj
ciel(x) Returns the smallest integer that is greater than or equal to x (i.e : rounds up the nearest integer).
Input : 2.5
Output : 3
Input : -2.1
Output : -2
floor(x) : Returns the largest integer that is smaller than or equal to x (i.e : rounds downs the nearest integer).
Input : 2.5
Output : 2
Input : -2.1
Output : -3
1Pick 2 elements(a, b), compare them. (say a > b)
2. Update min by comparing (min, b)
3. Update max by comparing (max, a)
Therefore, we need 3 comparisons for each 2 elements, so total number of required comparisons will be (3n)/2 – 2, because we do not need to update min or max in the very first step.