questionwrite down a c program sortc that


Question

Write down a C program Sort.c that performs a combine sort on two number sequences produced by program in Q1. Sort.c should spawn two processes and each of children processes would exec() the Gen program to produce a sequence.Sort.c has to also specify the filenames for number sequences while spawning the children processes. The parent process have to then wait for the termination of children processes and execute a merge sort on the 2 data files. The final sorted sequence is on paper to the file "Sort.out".

Algorithm for merge sort can be approximately described as-

1. Read num1 from datafile1

2. Read num2 from datafile2

3. Write the smaller between num1 and num2 to output

4. "refill" num1 or num2 according to which one has been
outputted in step(3).

5. Repeat (3) and (4) until both files are exhausted.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: questionwrite down a c program sortc that
Reference No:- TGS0444069

Expected delivery within 24 Hours