Greedy Implementations

Last updated: 2nd Dec, 2020

Minimum Product Subset

Module:greedy_algorithms()
Method : min_product_subset(arr,hint=False)
Uses : This method is used to return an integer p such that p is the minimum of the products of all the subsets.
Parameters : arr - an one dimensional array as python list, hint is passed False by default, by declaring hint=True a detailed description of the greedy algorithm can be found.

Python Code Example
from edualgo import algorithms as al
ping = al.greedy_algorithms()
arr = [-1,-1,2,3,-1]
ping.min_product_subset(arr)
Output:
[-1, -1, 2, 3, -1]
-6


    
For getting the hint just pass hint=True in the function like - min_product_subset(arr,True).

Are you an ambitious Python Developer ?

Instance Theme

Do you want to contribute to our project ? We welcome every python lover to come forwards and have some fun with our source code. Steps to contibute:

  • Send an email to the developer here regarding your willingness to contribute to the project.
  • Have a read of our "How To Contribute" documentation here.
Keep coding, keep loving python