Question: Copy a doubly linked list into an array (recursively c++) int copyToArray(node*head, int Array[]) { if(!head) return 0; Array[]= head->data; return copyToArray(head->next,Array); } How do
Copy a doubly linked list into an array (recursively c++)
int copyToArray(node*head, int Array[])
{
if(!head)
return 0;
Array[]= head->data;
return copyToArray(head->next,Array);
}
How do I call this from main? Do I have to worry about the previous pointer?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
