Node * addlist(int carry,Node *first, Node *second)
{
if(first == NULL && second == NULL)
return NULL;
struct Node *res = createNode(0);
int value=carry;
value+=(first->data+second->data);
struct Node *more = addlist( value/10,first!=NULL ? first->next:NULL,second!=NULL ? second->next:NULL);
if(more == NULL && value>=10)
{// in the top of this stack a null will return;this is only run on the second layer of the function stack
Node *newTail = createNode(0);
{
if(first == NULL && second == NULL)
return NULL;
struct Node *res = createNode(0);
int value=carry;
value+=(first->data+second->data);
struct Node *more = addlist( value/10,first!=NULL ? first->next:NULL,second!=NULL ? second->next:NULL);
if(more == NULL && value>=10)
{// in the top of this stack a null will return;this is only run on the second layer of the function stack
Node *newTail = createNode(0);