Skip to content

Greedy Technique

1 post1 contributor

+ FollowBe the first to follow this
Write about it

Articles about Greedy Technique

  1. Subset Sum on Generated Sequence

    Subset Sum on Generated Sequence is a Greedy Algorithm problem where a sequence is dynamically generated from an initial value s and the given array arr[]. Each new value is calculated using the sum of all previously generated values plus the current array element. The generated sequence has a special property where each new value is greater than the sum of all previous values. This property allows us to determine whether a target x can be formed efficiently by processing the sequence from largest to smallest and greedily selecting suitable values. The solution runs in O(n) time and uses O(n) auxiliary space.

    Sandhiya PriyaSandhiya Priya3391,000