SmartExpert

(118)

$30/per page/Negotiable

About SmartExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,English,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 56 Weeks Ago, 4 Days Ago
Questions Answered: 7570
Tutorials Posted: 7352

Education

  • BS,MBA, PHD
    Adelphi University/Devry
    Apr-2000 - Mar-2005

Experience

  • HOD ,Professor
    Adelphi University
    Sep-2007 - Apr-2017

Category > Business & Finance Posted 24 May 2017 My Price 12.00

Write a program that reads two input files whose lines are ordered by a key data field.

Write a program that reads two input files whose lines are ordered by a key data field. Your program should merge these two files, writing an output file that contains all lines from both files ordered by the same key field. As an example, if two input files contain student names and grades for a particular class ordered by name, merge the information as shown below

You must read one line of a file at a time and either write it or the last line read from the other data file to the output file. A common merge algorithm is the following:

Read a line from each data file

While the end of both files has not been reached

If the line from file 1 is smaller than the line from file 2

Write the line from file 1 to the output file and read a new

line from file 1

Else

Write the line from file 2 to the output file and read a new line from file 2.

Write the remaining lines (if any) from file 1 to the output file.

Write the remaining lines (if any) from file 2 to the output file.

Answers

(118)
Status NEW Posted 24 May 2017 10:05 PM My Price 12.00

Ple-----------ase----------- fi-----------nd -----------the----------- co-----------de -----------bel-----------ow.----------- Co-----------de -----------is -----------com-----------men-----------ted----------- so----------- th-----------at -----------it -----------is -----------eas-----------y t-----------o u-----------nde-----------rst-----------and-----------. A-----------lso-----------, f-----------ind----------- at-----------tac-----------hed----------- fi-----------les----------- us-----------ed -----------in -----------tes-----------t r-----------un -----------of -----------pro-----------gra-----------m: -----------fil-----------e1.-----------txt-----------, f-----------ile-----------2.t-----------xt

Attachments

file 1495665966-1845592_1_636243876295806536_file1.txt preview (4 words )
Ada-----------ms -----------C -----------Jon-----------es -----------D -----------Kin-----------g B-----------
file 1495665971-1845592_2_636243876295806536_file2.txt preview (3 words )
Bar-----------nes----------- A ----------- Jo-----------hns-----------on -----------C-----------
file 1495665977-1845592_3_636243876295806536_result.txt preview (6 words )
Ada-----------ms -----------C -----------Bar-----------nes----------- A ----------- Jo-----------hns-----------on -----------C -----------Jon-----------es -----------D -----------Kin-----------g B----------- -----------
Not Rated(0)