Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started