<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>20bits - Latest Comments in Introduction to Dynamic Programming</title><link>http://20bits.disqus.com/</link><description></description><atom:link href="https://20bits.disqus.com/introduction_to_dynamic_programming_20bits/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 08 Jun 2011 12:58:05 -0000</lastBuildDate><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-221374810</link><description>&lt;p&gt;&amp;gt; What if all the numbers in the array are negative?&lt;/p&gt;&lt;p&gt;Then the "largest subarray with the maximum sum" will be an array containing just the single "largest" number (i.e. closest to zero).   e.g. in the array [-5,-6,-2,-3]  the result would be [-2], because it is the largest, and adding anything more to it would make it smaller (more negative).  I think his python code works correctly for this case.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jeremy Wilson</dc:creator><pubDate>Wed, 08 Jun 2011 12:58:05 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-205605632</link><description>&lt;p&gt; Atpresent. on get older. goodness me form welcomes be only a little more low-key. I personally start to wearsophisticated basic color during. on some courtly pandora metallic bracelets .&lt;br&gt;From time to time. I’d would rather &lt;a href="http://www.pandoraukshop.com/pandora-charms.html" rel="nofollow noopener" target="_blank" title="http://www.pandoraukshop.com/pandora-charms.html"&gt;&lt;b&gt;pandora charms sale&lt;/b&gt;&lt;/a&gt;purchase an enormous red-colored hand-bag that i won`teconomic utilization most probably. as well as toss directly towards water closetbecause various years. purchase a manufacturer new neutral-colored ladies handbag &lt;a href="http://www.pandoraukshop.com/pandora-bracelets.html" rel="nofollow noopener" target="_blank" title="http://www.pandoraukshop.com/pandora-bracelets.html"&gt;&lt;b&gt;pandora bracelets on sale&lt;/b&gt;&lt;/a&gt;possessing pandora silver valuable metal charms beat would appear more from significance while have the ability&lt;a href="http://www.pandoraukshop.com/pandora-bracelets.html" rel="nofollow noopener" target="_blank" title="http://www.pandoraukshop.com/pandora-bracelets.html"&gt;&lt;b&gt;pandora bracelets outlet&lt;/b&gt;&lt;/a&gt; to pat it it does not create a difference throughout the evening or possibly overnight.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">lutyu319</dc:creator><pubDate>Tue, 17 May 2011 21:34:00 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-143074979</link><description>&lt;p&gt;its good but explain it with some example&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rajranimehra</dc:creator><pubDate>Tue, 08 Feb 2011 19:57:43 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-142441394</link><description>&lt;p&gt;Hi. How could I retrieve the combination of items used to produce the optimal solution to the knapsack problem?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hugo A M Torres</dc:creator><pubDate>Tue, 08 Feb 2011 01:37:43 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-105011416</link><description>&lt;p&gt;is there  a ydynamic member in variable if there please give me one&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chad salvador</dc:creator><pubDate>Tue, 30 Nov 2010 03:43:30 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-104502488</link><description>&lt;p&gt;its the tree between my legs, consist of a big banana and two eggs&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Amdkfgi</dc:creator><pubDate>Sun, 28 Nov 2010 14:33:35 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-90719067</link><description>&lt;p&gt;what is definition of optimal binary search tree and its algorithm described?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sarthakgovind</dc:creator><pubDate>Wed, 27 Oct 2010 08:51:13 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-49904216</link><description>&lt;p&gt;thanks..it helped a lot&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">vivek</dc:creator><pubDate>Wed, 12 May 2010 11:10:26 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-43136498</link><description>&lt;p&gt;Again thanks, just thought I might add though that my only feedback would be perhaps writing the example code in a more readable rather than compact way could help. e.g. &lt;br&gt;for i in range(len(a)):&lt;br&gt;        t = t + a[i]&lt;br&gt;        if t &amp;gt; s:&lt;br&gt;            bounds = (j, i+1)&lt;br&gt;            s = t&lt;br&gt;        if t &amp;lt; 0:&lt;br&gt;            t = 0&lt;br&gt;            j = i+1&lt;br&gt;    return (s, bounds)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nelson</dc:creator><pubDate>Sun, 04 Apr 2010 00:02:47 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-43134737</link><description>&lt;p&gt;Buddy quit whining over free lollies. This guy's giving helpful information out for free, if you don't like it then tough. Eat a dick or something. &lt;br&gt;By the way thanks for the info jesse, I'm trying to get my head around dynamic programming and I appreciate the help. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nelson</dc:creator><pubDate>Sat, 03 Apr 2010 23:33:06 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-38200725</link><description>&lt;p&gt;I always tend to go for recursive functions, as they are easy to debug&lt;/p&gt;&lt;p&gt;# s: new number in the seq&lt;br&gt;# s_1: the prev number in the sequence&lt;br&gt;# i : iterator, which can be eliminated &lt;br&gt;#     if implemented as a local function (like Scheme)&lt;br&gt;def fibo(n, i=1, s=1, s_1=0):&lt;br&gt;    if n &amp;lt;= i: return s&lt;br&gt;    else: return fibo(n, i+1, s+s_1, s)&lt;/p&gt;&lt;p&gt;print (fibo(10))&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">swapneelpatil</dc:creator><pubDate>Fri, 05 Mar 2010 14:15:25 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-32809304</link><description>&lt;p&gt;Dynamic Programming is a type of D&amp;amp;C algorithm, but it relies on the existence of overlapping subproblems.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Farmer</dc:creator><pubDate>Fri, 05 Feb 2010 22:03:08 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-32724052</link><description>&lt;p&gt;What is the basic difference between Divide-and-Conquer Technique and Dynamic Programming??&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">disqus_NfQ8E9Byln</dc:creator><pubDate>Fri, 05 Feb 2010 07:30:45 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-12765879</link><description>&lt;p&gt;great post, &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">coderoger</dc:creator><pubDate>Thu, 16 Jul 2009 16:48:28 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-11726448</link><description>&lt;p&gt;Nice work. Keep it up.....&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pickatutorial</dc:creator><pubDate>Thu, 25 Jun 2009 11:14:11 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-11610028</link><description>&lt;p&gt;Superb tutorial..........nice one!!!!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">biker</dc:creator><pubDate>Tue, 23 Jun 2009 03:49:53 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-9485784</link><description>&lt;p&gt;Excellent..&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nilavalagan</dc:creator><pubDate>Mon, 18 May 2009 00:39:21 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3798163</link><description>&lt;p&gt;you should make a function that returns the nth fibonacci number without using recursion.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">james</dc:creator><pubDate>Sun, 16 Nov 2008 02:55:45 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3794181</link><description>&lt;p&gt;Come to think of it, I think this might be cleaner:&lt;/p&gt;&lt;p&gt;def fib2(n):&lt;br&gt;	n2, n1 = 0, 1&lt;br&gt;	for i in range(n):&lt;br&gt;		n2, n1 = n1, n1 + n2&lt;br&gt;	return n2&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SimonTewbi</dc:creator><pubDate>Sat, 15 Nov 2008 17:33:00 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3794022</link><description>&lt;p&gt;Great article, thanks Jesse.&lt;/p&gt;&lt;p&gt;By the way, I believe your fib2 function is missing a line.  It is incorrect for n=0.  I think it should read:&lt;/p&gt;&lt;p&gt;def fib2(n):&lt;br&gt;	if n == 0: return 0&lt;br&gt;	n2, n1 = 0, 1&lt;br&gt;	for i in range(n-2):&lt;br&gt;		n2, n1 = n1, n1 + n2&lt;br&gt;	return n2 + n1&lt;/p&gt;&lt;p&gt;Cheers&lt;br&gt;Simon&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SimonTewbi</dc:creator><pubDate>Sat, 15 Nov 2008 17:10:22 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793298</link><description>&lt;p&gt;offo,&lt;/p&gt;&lt;p&gt;Sorry for making you work so hard.  Do you have any examples of good graphs?&lt;/p&gt;&lt;p&gt;Help me learn — don't just berate me.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse</dc:creator><pubDate>Sat, 15 Nov 2008 16:53:52 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793297</link><description>&lt;p&gt;Ok if I want to a view an image I don't want to see some stupid transition. Show me the goddamn image.&lt;/p&gt;&lt;p&gt;Second, your graphs are hard to read. Why does your graph use a gradient background? The change in contrast makes it difficult to read and gives really no benefit.&lt;/p&gt;&lt;p&gt;Also your graphs go against the norm, the label of the y axis is upside down. I don't care if it is your software or some designer jerk being a douchebag suggesting this is better...&lt;/p&gt;&lt;p&gt;IT ISN'T. I have to parse through 100s of chart a day in my day job and this kind of shit just pisses me off. I shouldn't have to fight with your eye-candy.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">offo foffo</dc:creator><pubDate>Sat, 15 Nov 2008 16:25:04 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793301</link><description>&lt;p&gt;Great post - simple introduction to a complex algorithmic concept.&lt;/p&gt;&lt;p&gt;Regarding the knapsack problem, once the table is ready, the complexity is indeed only O(nW)&lt;br&gt;But building the table itself is of exponential cost in terms of running time, correct?&lt;br&gt;We go through every single possibility using recursion to build the table, and I think running time to build the table is n^m. It would be great if you could clarify.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Metta</dc:creator><pubDate>Sat, 18 Oct 2008 19:27:20 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793295</link><description>&lt;p&gt;Horst,&lt;/p&gt;&lt;p&gt;Thanks.  I wrote this like a year and a half ago — I'm surprised nobody has caught that yet.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse</dc:creator><pubDate>Sun, 12 Oct 2008 13:13:06 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793294</link><description>&lt;p&gt;Jack,&lt;/p&gt;&lt;p&gt;I'm using a Ruby graphing library called Gruff.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse</dc:creator><pubDate>Sun, 12 Oct 2008 13:12:29 -0000</pubDate></item></channel></rss>