1st ques
struct Node
{ datatype DATA
struct Node * next;
struct Node * random;
};
struct Node * cloneList(Node * original)
{
  struct Node *p,*q,*r;
        for(p = original; p != null; p = p->next->next)
    {
     q = p->next;
     p->next = getNewNode();
    p->next->next = q;
  }
for(p = original; p != null; p = p->next->next)
    p->next->random = p->random->next;

for( q =original->next,r = original->next,p = original; p != null; p =
p->next,q=q->next)
{
   p->next = p->next->next;
  q->next = q->next->next;
}



return r;
}



On Tue, Sep 8, 2009 at 6:04 PM, ankur aggarwal <ankur.mast....@gmail.com>wrote:

> @bharat
> your statement is not clear..
>
> On Tue, Sep 8, 2009 at 11:51 AM, Bharath <bharath1...@gmail.com> wrote:
>
>>
>> Slightly modifying first question.
>>
>> Check whether a string is palindrome in single pass.
>>
>> Meaning an online algorithm is required, i.e. it must be able to read
>> one character at a time from a stream and tells whether string read so
>> far is palindrome or not.
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to