T* reverseLinklist(T* p){
T* rHead = p;
if(p == NULL || p->next == NULL)
return p;
p = p->next;
rHead->next = NULL;
reverseLinklistRecursive(p, rHead);
return rHead;
}
void reverseLinklistRecursive(T* p, T* rHead)
{
if(p=NULL)
return;
T* tmp = p->next;
p->next = rHead;
rHead = p;
p = p->next;
reverseLinklistRecursive(p, rHead);
}