<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments for OpenAsthra</title>
	<link>http://www.openasthra.com</link>
	<description>C/C++ Programming Blog</description>
	<pubDate>Sun, 11 May 2008 23:55:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>Comment on Reversing single linked list recursively by Dan</title>
		<link>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-26449</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Thu, 08 May 2008 07:14:07 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-26449</guid>
		<description>Why static??</description>
		<content:encoded><![CDATA[<p>Why static??</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Balanced (AVL) Binary Search Trees by SverreN</title>
		<link>http://www.openasthra.com/c-tidbits/balanced-avl-binary-search-trees/#comment-24865</link>
		<dc:creator>SverreN</dc:creator>
		<pubDate>Fri, 02 May 2008 12:28:16 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/balanced-avl-binary-search-trees/#comment-24865</guid>
		<description>I forgot to mention.

Other than the suspected bug mentioned above your post (and code) is really good. Good work. :)</description>
		<content:encoded><![CDATA[<p>I forgot to mention.</p>
<p>Other than the suspected bug mentioned above your post (and code) is really good. Good work. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Balanced (AVL) Binary Search Trees by SverreN</title>
		<link>http://www.openasthra.com/c-tidbits/balanced-avl-binary-search-trees/#comment-24864</link>
		<dc:creator>SverreN</dc:creator>
		<pubDate>Fri, 02 May 2008 12:25:57 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/balanced-avl-binary-search-trees/#comment-24864</guid>
		<description>Isn't there a bug in your sources?

It seems to me that in your function double_rotation_with_right you should use:
    k-&#62;right = single_rotation_with_left(k3-&#62;right);
and not:
    k-&#62;left = single_rotation_with_left(k3-&#62;right);

You can easilly test this out using with this example insertion sequence:
5, 10, 8

Obviously this will require balancing. To me it seems like your code will mess up the binary tree, creating a circular reference when you balance after having inserted the 8.


Proposed correct code:

Tree *double_rotation_with_right(Tree *k3)
{
  //rotate between k1 &#38; k2
  k3-&#62;right = single_rotation_with_left(k3-&#62;right);
 
  //rotate between k3 &#38; k2
  return single_rotation_with_right(k3);
}</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t there a bug in your sources?</p>
<p>It seems to me that in your function double_rotation_with_right you should use:<br />
    k-&gt;right = single_rotation_with_left(k3-&gt;right);<br />
and not:<br />
    k-&gt;left = single_rotation_with_left(k3-&gt;right);</p>
<p>You can easilly test this out using with this example insertion sequence:<br />
5, 10, 8</p>
<p>Obviously this will require balancing. To me it seems like your code will mess up the binary tree, creating a circular reference when you balance after having inserted the 8.</p>
<p>Proposed correct code:</p>
<p>Tree *double_rotation_with_right(Tree *k3)<br />
{<br />
  //rotate between k1 &amp; k2<br />
  k3-&gt;right = single_rotation_with_left(k3-&gt;right);</p>
<p>  //rotate between k3 &amp; k2<br />
  return single_rotation_with_right(k3);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reversing a double linked list by Kanza</title>
		<link>http://www.openasthra.com/c-tidbits/reversing-a-double-linked-list/#comment-24507</link>
		<dc:creator>Kanza</dc:creator>
		<pubDate>Thu, 01 May 2008 06:51:47 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/reversing-a-double-linked-list/#comment-24507</guid>
		<description>Hello!
    Well the information given in your website is proved to be very useful for me. I could not find this information in any other website. Specially the reversing  of linked lists.
                                        Thank You ,
                                         Kanza</description>
		<content:encoded><![CDATA[<p>Hello!<br />
    Well the information given in your website is proved to be very useful for me. I could not find this information in any other website. Specially the reversing  of linked lists.<br />
                                        Thank You ,<br />
                                         Kanza</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reversing single linked list recursively by ponnada</title>
		<link>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-24298</link>
		<dc:creator>ponnada</dc:creator>
		<pubDate>Wed, 30 Apr 2008 04:45:51 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-24298</guid>
		<description>aftab,
I'd not given complete code (only reverse function I gave) not sure how you made a complete piece of code (by writing yours or plugging from other artilces) and not sure how you run, here I'm gibing complete code
&lt;a href="http://www.openasthra.com/wp-content/uploads/sll_reverse_complete.c" rel="nofollow"&gt;complete code&lt;/a&gt;
I'm not facing any problems, let me know
 if you face any problems further</description>
		<content:encoded><![CDATA[<p>aftab,<br />
I&#8217;d not given complete code (only reverse function I gave) not sure how you made a complete piece of code (by writing yours or plugging from other artilces) and not sure how you run, here I&#8217;m gibing complete code<br />
<a href="http://www.openasthra.com/wp-content/uploads/sll_reverse_complete.c" rel="nofollow">complete code</a><br />
I&#8217;m not facing any problems, let me know<br />
 if you face any problems further</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reversing single linked list recursively by aftab</title>
		<link>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-24291</link>
		<dc:creator>aftab</dc:creator>
		<pubDate>Tue, 29 Apr 2008 09:05:06 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-24291</guid>
		<description>I tried  the piece of code by "ponnada"  on a solaris platform just to see the result......
Segmentation Fault(coredump)
aftab</description>
		<content:encoded><![CDATA[<p>I tried  the piece of code by &#8220;ponnada&#8221;  on a solaris platform just to see the result&#8230;&#8230;<br />
Segmentation Fault(coredump)<br />
aftab</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reversing single linked list recursively by ponnada</title>
		<link>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-22382</link>
		<dc:creator>ponnada</dc:creator>
		<pubDate>Thu, 17 Apr 2008 13:56:22 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-22382</guid>
		<description>Hi Aksu,
&#62;The implementation crashes if the list is empty
Yes, it crashes for empty list, it was just an overlook, and simple check should suffice to stop that
&#62;does not work in a multithreaded system
I didn't claim that it works for multithread env, if I would have intention of multithread env, i would have not used static variables.. surprisingly your version also suffers from empty list crash scenario.
Anyways thanks for pointing out that bug.</description>
		<content:encoded><![CDATA[<p>Hi Aksu,<br />
&gt;The implementation crashes if the list is empty<br />
Yes, it crashes for empty list, it was just an overlook, and simple check should suffice to stop that<br />
&gt;does not work in a multithreaded system<br />
I didn&#8217;t claim that it works for multithread env, if I would have intention of multithread env, i would have not used static variables.. surprisingly your version also suffers from empty list crash scenario.<br />
Anyways thanks for pointing out that bug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reversing single linked list recursively by Aksu</title>
		<link>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-22381</link>
		<dc:creator>Aksu</dc:creator>
		<pubDate>Thu, 17 Apr 2008 08:37:09 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/reversing-single-linked-list-recursively/#comment-22381</guid>
		<description>I can only guess that the previous comments were ironic...

The implementation crashes if the list is empty, does not work in a multithreaded system, and is far from elegant.

Consider:

/* helper func */
struct Node* reverse(struct Node* current, struct Node* previous)
    {
    struct Node* next = current-&#62;next;
    current-&#62;next = previous;
    if (next)
        {
        return reverse(next, current);
        }
    return current;
    }

struct Node* reverse(struct Node* aHead)
    {
    if (aHead) 
        {
        return reverse(aHead, NULL);
        {
    return NULL;
    }</description>
		<content:encoded><![CDATA[<p>I can only guess that the previous comments were ironic&#8230;</p>
<p>The implementation crashes if the list is empty, does not work in a multithreaded system, and is far from elegant.</p>
<p>Consider:</p>
<p>/* helper func */<br />
struct Node* reverse(struct Node* current, struct Node* previous)<br />
    {<br />
    struct Node* next = current-&gt;next;<br />
    current-&gt;next = previous;<br />
    if (next)<br />
        {<br />
        return reverse(next, current);<br />
        }<br />
    return current;<br />
    }</p>
<p>struct Node* reverse(struct Node* aHead)<br />
    {<br />
    if (aHead)<br />
        {<br />
        return reverse(aHead, NULL);<br />
        {<br />
    return NULL;<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Double Linked List With Out Using Special Head or Tail Node by nancy</title>
		<link>http://www.openasthra.com/c-tidbits/double-linked-list/#comment-21200</link>
		<dc:creator>nancy</dc:creator>
		<pubDate>Sat, 12 Apr 2008 16:09:30 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/double-linked-list/#comment-21200</guid>
		<description>but how i sort adoubly linked list?</description>
		<content:encoded><![CDATA[<p>but how i sort adoubly linked list?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reversing a double linked list by jazzyg</title>
		<link>http://www.openasthra.com/c-tidbits/reversing-a-double-linked-list/#comment-17463</link>
		<dc:creator>jazzyg</dc:creator>
		<pubDate>Mon, 31 Mar 2008 09:47:58 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/reversing-a-double-linked-list/#comment-17463</guid>
		<description>In case of dounly link list, its pretty eay to reverse it. Simply reverse prev and Next pointer in a node. Fot head, set prev = Null and for Tail, Next = Null</description>
		<content:encoded><![CDATA[<p>In case of dounly link list, its pretty eay to reverse it. Simply reverse prev and Next pointer in a node. Fot head, set prev = Null and for Tail, Next = Null</p>
]]></content:encoded>
	</item>
</channel>
</rss>
