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

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 [removed] 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; }
 
Looking for a similar assignment? Our writers will offer you original work free from plagiarism. We follow the assignment instructions to the letter and always deliver on time. Be assured of a quality paper that will raise your grade. Order now and Get a 15% Discount! Use Coupon Code "Newclient"