Design and Analysis of Algorithm
Design and Analysis of Algorithm
• D&C divides the problem of size C(n, k), in two sub problems,
each of size C(n – 1, k – 1) and C(n – 1, k) respectively.
• Solution of larger problem is build by adding solution of these two sub
problems.
• Structure of binomial coefficient problem using divide and conquer approach
is described as :
Where n>k>0
• Many sub problems are called again and again, since they have an
overlapping sub problems property.
• Re-computations of the same sub problems is avoided by storing their
results in the temporary array C[i, j] in a bottom up manner.
• The optimal substructure for using dynamic programming is stated as,
• So, maximum possible value that can be put into the knapsack = 7. With v={1,1,0,0}
• https://www.gatevidyalay.com/0-1-knapsack-problem-using-dynamic-
programming-approach/
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 28
Example2
• Refer PDF 1
• https://www.javatpoint.com/0-1-knapsack-problem.
• The time complexity for the 0/1 Knapsack problem solved using DP is
• O(N*W) (Linear) where
• N denotes the number of items available and
• W denotes the capacity of the knapsack.
• https://scholarworks.uark.edu/cgi/viewcontent.cgi?article=1516&con
text=jaas
• https://www.spatialpost.com/applications-of-gps/
• https://psl.noaa.gov/psd3/multi/remote/
• https://www.uber.com/en-IN/blog/rethinking-gps/