Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please complete the code below. I am given two sorted linked lists as it is show

ID: 3565974 • Letter: P

Question

Please complete the code below. I am given two sorted linked lists as it is shown in the parameter. Using node manipulation I have to merge sort the two lists.

void mergesort(list1 list2){

// TODO: your code goes here
// + this function merges the current list with the list pointed to by
// theOther.head
// + we assume that both lists are already sorted
// + by manipulating pointers, eventually head points to a sorted (merged)
// list, and you have to set theOther.head = NULL and theOther.numNodes = 0
// after all is done.
// + update numNodes accordingly too

}

Explanation / Answer

int main()
{
   int no;
   cin>>no;
   int arr=new int[no];
   for(int i=1;i<=no;i++)
   {
       cout<<arr[i]=i;  
   }
   for(int k=1;k<=no;k++)
   {
       for(int z=1;z<=no;z++)
       {
           cout<<arr[z]<<",";
       }
       cut<<endl;
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote