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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!