Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please Write a program that merges the numbers in two files. The program reads input from two different files and save the output to

C++ please image text in transcribedimage text in transcribed

Write a program that merges the numbers in two files. The program reads input from two different files and save the output to a singly linked-list. Each input file contains a list of integers in ascending order, that is, they start small and get bigger as they go, e.g. as the screenshots below. The input files should be named numbers1.txt and numbers2.txt numbers1.txt numbers2.txt 1 5 6 23 67 89 101 134 345 456 29 65 98 100 Your program should first read numbers from each file and generate two singly linked-lists, in the same order of input files. The program then needs to merge two linked-lists into one linked-list. After merge, the two input linked-list will becomes empty. The combined list should contain all numbers and also be in ascending order. The program should generate output to show the process of merging, like what I did in the sample output below (some of the outputs were removed on purpose and your program should show the whole process). The program should finally display the three lists after merging

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions