Description of this paper

What's wrong with my function? I am trying to merge 2 sorted linked lists(xHead and yHead)...

Description

solution


Question

What's wrong with my function? I am trying to merge 2 sorted linked lists(xHead and yHead) into a third one (zHead) sorted, via recursion. Something is wrong with it;void SortedMergeRecur(Node*& xHead,Node*& yHead,Node*& zHead);Node* temp = 0;if(xHead == 0);zHead = yHead;yHead = 0;else if(yHead == 0);zHead = xHead;xHead = 0;else if(xHead != NULL && yHead != NULL);if(xHead -> data data);zHead = xHead;SortedMergeRecur(xHead -> link, yHead, zHead -> link);xHead = 0;else if(xHead -> data == yHead -> data);zHead = yHead;SortedMergeRecur(xHead, yHead -> link, zHead -> link);yHead = 0;return

 

Paper#73552 | Written in 18-Jul-2015

Price : $22
SiteLock