Optimal Substructure Property A given optimal substructure property if the optimal solution of the given problem can be obtained by finding the…
divide and conquer
-
-
Need of Algorithm 1. To understand the basic idea of the problem. 2. To find an approach to solve the problem. 3.…
-
Tower of Hanoi 1. It is a classic problem where you try to move all the disks from one peg to another…
-
Minimum Spanning Tree Before knowing about the minimum spanning tree, we should know about the spanning tree. To understand the concept of…
-
Dynamic programming vs Greedy approach Before understanding the differences between the dynamic programming and greedy approach, we should know about the dynamic…
-
Overlapping sub-problems Dynamic programming is an approach used to solve the complex problem by breaking down the problem into sub-problems and storing…
-
Network Flow Problems The most obvious flow network problem is the following: Problem1: Given a flow network G = (V, E), the…
-
Traveling-salesman Problem In the traveling salesman Problem, a salesman must visits n cities. We can say that salesman wishes to make a…
-
Prim’s Algorithm It is a greedy algorithm. It starts with an empty spanning tree. The idea is to maintain two sets of…
-
Differentiate between Dynamic Programming and Greedy Method Dynamic Programming Greedy Method 1. Dynamic Programming is used to obtain the optimal solution. 1.…