diff options
Diffstat (limited to 'dynamic-programming.html.markdown')
-rw-r--r-- | dynamic-programming.html.markdown | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/dynamic-programming.html.markdown b/dynamic-programming.html.markdown index c73b1845..3e3c0413 100644 --- a/dynamic-programming.html.markdown +++ b/dynamic-programming.html.markdown @@ -3,6 +3,7 @@ category: Algorithms & Data Structures name: Dynamic Programming contributors: - ["Akashdeep Goel", "http://github.com/akashdeepgoel"] + - ["Miltiadis Stouras", "https://github.com/mstou"] --- # Dynamic Programming @@ -22,7 +23,7 @@ Always remember! ## Example of Dynamic Programming -The Longest Increasing Subsequence problem is to find the longest increasing subsequence of a given sequence. Given a sequence `S= {a1 , a2 , a3, a4, ............., an-1, an }` we have to find a longest subset such that for all `j` and `i`, `j<i` in the subset `aj<ai`. +The Longest Increasing Subsequence problem is to find the longest increasing subsequence of a given sequence. Given a sequence `S={ a1, a2, a3, a4, ............., an-1, an }` we have to find a longest subset such that for all `j` and `i`, `j<i` in the subset `aj<ai`. First of all we have to find the value of the longest subsequences(LSi) at every index i with last element of sequence being ai. Then largest LSi would be the longest subsequence in the given sequence. To begin LSi is assigned to be one since ai is element of the sequence(Last element). Then for all `j` such that `j<i` and `aj<ai`, we find Largest LSj and add it to LSi. Then algorithm take *O(n2)* time. Pseudo-code for finding the length of the longest increasing subsequence: @@ -48,6 +49,15 @@ for i=0 to n-1 ## Online Resources -* [codechef](https://www.codechef.com/wiki/tutorial-dynamic-programming) +* MIT 6.006: [Lessons 19,20,21,22](https://www.youtube.com/playlist?list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb) +* TopCoder: [Dynamic Programming from Novice to Advanced](https://www.topcoder.com/community/data-science/data-science-tutorials/dynamic-programming-from-novice-to-advanced/) +* [CodeChef](https://www.codechef.com/wiki/tutorial-dynamic-programming) * [InterviewBit](https://www.interviewbit.com/courses/programming/topics/dynamic-programming/) - +* GeeksForGeeks: + * [Overlapping Subproblems](https://www.geeksforgeeks.org/dynamic-programming-set-1/) + * [Tabulation vs Memoization](https://www.geeksforgeeks.org/tabulation-vs-memoizatation/) + * [Optimal Substructure Property](https://www.geeksforgeeks.org/dynamic-programming-set-2-optimal-substructure-property/) + * [How to solve a DP problem](https://www.geeksforgeeks.org/solve-dynamic-programming-problem/) +* [How to write DP solutions](https://www.quora.com/Are-there-any-good-resources-or-tutorials-for-dynamic-programming-DP-besides-the-TopCoder-tutorial/answer/Michal-Danilák) + +And a [quiz](https://www.commonlounge.com/discussion/cdbbfe83bcd64281964b788969247253) to test your knowledge. |