Design and Analysis of Algorithm
Design and Analysis of Algorithm
Q. Write algorithm greedy (a, n) where a[1:n] contains n inputs and with respect to
this explain Greedy method of algorithm design.
Selection -> Function that selects an input from a[] and removes it. The selected
input’s value is assigned to X.
Feasible -> Boolean valued function that determines whether x can be included
into the solution vector.
Union -> Function that combines X with solution
and updates the objective function