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? Get Expert Help at an Amazing Discount!”

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

The post What’s wrong with my function ? I am trying to merge 2 sorted linked lists( xHead and yHead )… appeared first on Nursing Assignment.

 

“Are you looking for this answer? We can Help click Order Now”