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
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
English,
7 months ago
Social Sciences,
7 months ago
Geography,
7 months ago
History,
1 year ago
Business Studies,
1 year ago
Social Sciences,
1 year ago