Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS110: Assignment 12 1. (90 points) In this assignment, you will be implementing an algorithm to merge two individually sorted files. Write a program, MergeSortedNumbers.java,

image text in transcribedimage text in transcribedimage text in transcribed

CS110: Assignment 12 1. (90 points) In this assignment, you will be implementing an algorithm to merge two individually sorted files. Write a program, MergeSortedNumbers.java, that asks the user to enter the location of two files. Create a method public static double[] readNums(String file to read numbers from a file and store it in an array Create another method public static double [] mergeSort (double [] arrl , double[ arr2) to merge the two arrays so that the final array is sorted Finally, create method public static void writenumbers (String filepath, doublell mergeArray) to save the numbers to a destination file Assume that the numbers in each individual file are sorted. Now create a new array as the combination of the two arrays in a way that allthe numbers are sorted

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

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

1. Explain the 2nd world war. 2. Who is the father of history?

Answered: 1 week ago