Question: Write a program that will read in two numbers in as strings. Your program should store the digits in the number as a sort linked

Write a program that will read in two numbers in as strings. Your program should store the digits in the number as a sort linked list. Your program should then merge the two linked list together in sorted order into a new linked list without changing the original two linked list. Your merge algorithm needs to run in O(n+m) time with n and m being the length of the two linked lists. You merge algorithm must be recursive.

Write a program that will read in two numbers in as strings.

USE C++ PLEASE

H:\Documents\CPCS1160\Lab 8\lab8.exe Enter a number026498 Enter a number124978912248 The linked lists 2->4->6->8->8->9 ->9 ->nullptr 3->0-1-1-2-2-4-4->7->7->9-9->nullptr Merged linked lists 9->8-1->1->2->2->2=>4->4->4-6->7->7->8->8->9-9-9-9->nullptr The original linked lists again 2->4->6->8->8->9->9->nullptr 3->8->1->1->2->2->4->4->7->7->9->9->nullptr

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!