Код: Выделить всё
count_last(node* head, int &last_node_data)
{
if(!head) return 0;
if(!head->next)
{last = head->data;
return 0;
}
count_last(head->next,last);
if(head->data == last)
//Increase count by 1;
}
Подробнее здесь: https://stackoverflow.com/questions/422 ... ast-node-i