Question: 5 Merge Two Linked Lists (20 points) This question asks you to merge two sorted linked lists into a single sorted linked list. An example

 5 Merge Two Linked Lists (20 points) This question asks you

5 Merge Two Linked Lists (20 points) This question asks you to merge two sorted linked lists into a single sorted linked list. An example of two sorted lists are shown in the figure below Merging the two sorted list changes some links. Figure (a) shows an example of two sorted linked lists. The modified links, as shown in Figure (b), are marked by thicker arrows. In this example, two links are changed A 18 B 35 47 35 47 This is another example of two sorted linked lists. Only one ink needs to be modified A 18 21 32 A 18 21 B 35 47 NULL 135 47 NULL This is yet another example of two sorted linked lists. When they merge, five links need to be modified A 18 31 42 A 118 31 NULL B (25 37 125 37 Consider two sorted linked lists storing distinct values (i.e., every value is unique) A: If each list has 2 nodes, what is the minumum number of changed links? B: If each list has 2 nodes, what is the maximum number of changed links? C: If each list has 4 nodes, what is the minimum number of changed links? D: If each list has 4 nodes, what is the maximum number of changed links

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!