<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Programming exercise: interweaved strings</title>
	<atom:link href="http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/feed/" rel="self" type="application/rss+xml" />
	<link>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/</link>
	<description>everything is an experiment</description>
	<lastBuildDate>Wed, 08 Feb 2012 05:45:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: hussien shahata</title>
		<link>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/comment-page-1/#comment-15057</link>
		<dc:creator>hussien shahata</dc:creator>
		<pubDate>Sun, 01 Jan 2012 12:35:53 +0000</pubDate>
		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2574#comment-15057</guid>
		<description>bool InterWaving(char* s1,int x,char* s2,int y,char* t,int z)
{
   count++;
	if((x+y)&gt;z)
		return false;
	else if(x==0&amp;&amp;y==0)
		return true;
	else if(s1[x-1]==t[z-1]&amp;&amp;s2[y-1]==t[z-1])
	{
		return InterWaving(s1,x-1,s2,y,t,z-1)&#124;&#124;InterWaving(s1,x,s2,y-1,t,z-1);
	}
	else if(s1[x-1]==t[z-1])
			return InterWaving(s1,x-1,s2,y,t,z-1);
	else if(s2[y-1]==t[z-1])
			return InterWaving(s1,x,s2,y-1,t,z-1);
	else
			return InterWaving(s1,x,s2,y,t,z-1);
	}</description>
		<content:encoded><![CDATA[<p>bool InterWaving(char* s1,int x,char* s2,int y,char* t,int z)<br />
{</p>
<pre>
  count++;
</pre>
<p>	if((x+y)&gt;z)<br />
		return false;<br />
	else if(x==0&amp;&amp;y==0)<br />
		return true;<br />
	else if(s1[x-1]==t[z-1]&amp;&amp;s2[y-1]==t[z-1])<br />
	{<br />
		return InterWaving(s1,x-1,s2,y,t,z-1)||InterWaving(s1,x,s2,y-1,t,z-1);<br />
	}<br />
	else if(s1[x-1]==t[z-1])<br />
			return InterWaving(s1,x-1,s2,y,t,z-1);<br />
	else if(s2[y-1]==t[z-1])<br />
			return InterWaving(s1,x,s2,y-1,t,z-1);<br />
	else<br />
			return InterWaving(s1,x,s2,y,t,z-1);<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: davinci</title>
		<link>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/comment-page-1/#comment-9693</link>
		<dc:creator>davinci</dc:creator>
		<pubDate>Wed, 31 Mar 2010 03:54:02 +0000</pubDate>
		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2574#comment-9693</guid>
		<description>It&#039;s just an exercise, so it&#039;s probably not that useful in the real world.  On the other hand, algorithms of this kind (but more sophisticated) are used in computational biology, such as for analysing gene sequences.  This sort of simple algorithm is also sometimes useful for playing with toy examples that illustrate a concept in theoretical computer science.  And finally, the ability to write code to solve relatively simple problems like this one is supposed to demonstrate the ability to solve more complex algorithmic problems, which is why this type of question is often asked in software engineering interviews.

But you&#039;re right, the algorithm and the problem it solves are not likely to be useful in real life.

-- davinci</description>
		<content:encoded><![CDATA[<p>It&#8217;s just an exercise, so it&#8217;s probably not that useful in the real world.  On the other hand, algorithms of this kind (but more sophisticated) are used in computational biology, such as for analysing gene sequences.  This sort of simple algorithm is also sometimes useful for playing with toy examples that illustrate a concept in theoretical computer science.  And finally, the ability to write code to solve relatively simple problems like this one is supposed to demonstrate the ability to solve more complex algorithmic problems, which is why this type of question is often asked in software engineering interviews.</p>
<p>But you&#8217;re right, the algorithm and the problem it solves are not likely to be useful in real life.</p>
<p>&#8211; davinci</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Moss</title>
		<link>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/comment-page-1/#comment-8283</link>
		<dc:creator>Peter Moss</dc:creator>
		<pubDate>Tue, 16 Mar 2010 03:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2574#comment-8283</guid>
		<description>That is all nice, but where would you use this code?
Scrambling?  Not sure where can this be really applied.

Peter</description>
		<content:encoded><![CDATA[<p>That is all nice, but where would you use this code?<br />
Scrambling?  Not sure where can this be really applied.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>

