Math, asked by TbiaSamishta, 1 year ago

given an array of positive decimal numbers find if there exists a triplet (a b c) such that 1 < a+b+c < 2 . o(n) solution is expected.

Answers

Answered by Sidyandex
0

It is given that the array has a set of positive decimal numbers and we need to find that whether or not there exist a triplet (a, b, c) such that 1 < a + b + c < 2.

In order to solve this o(n) solution, we first need to sort the array, in which pair (a, b), (b,c) and (a, c) will be made to sort and arrange the decimal numbers.

The algorithm will be repeated until a sorted array is found.

Similar questions