Sum Up

int Sum(Node *head)
{
    if (head == NULL)
        return 0;
    else
        return head->data + Sum(head->next);
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License