Problem 5: Let S be a set of n positive integers. (i) Design an O(n logn) algorithm to verify that: (VTCS)Σt ≥ |T|³). tET In other words, if there is some subset TCS such that the sum of the elements in T is less than |T|³, then the algorithm should return FALSE. Otherwise, it should return TRUE. (ii) In addition to S, you are given an integer 1 ≤ k ≤n. Design an O(n) algorithm to verify that: (VTS)(|T|= k⇒Σt≥ |T|³). tET

icon
Related questions
Question
Problem 5: Let S be a set of n positive integers.
(i) Design an O(n log n) algorithm to verify that:
(VTS)(Σt ≥ |T|³).
tET
In other words, if there is some subset TCS such that the sum of the elements in
T is less than |T|³, then the algorithm should return FALSE. Otherwise, it should
return TRUE.
(ii) In addition to S, you are given an integer 1 ≤ k ≤n. Design an O(n) algorithm to
verify that:
(VTS)(|T| = k→Σt ≥ |T|³).
tET
Transcribed Image Text:Problem 5: Let S be a set of n positive integers. (i) Design an O(n log n) algorithm to verify that: (VTS)(Σt ≥ |T|³). tET In other words, if there is some subset TCS such that the sum of the elements in T is less than |T|³, then the algorithm should return FALSE. Otherwise, it should return TRUE. (ii) In addition to S, you are given an integer 1 ≤ k ≤n. Design an O(n) algorithm to verify that: (VTS)(|T| = k→Σt ≥ |T|³). tET
Expert Solution
steps

Step by step

Solved in 5 steps

Blurred answer
Similar questions