I was asked to write a program, based on parent-child cooperation, which uses a “parallel” merge sort to a sequence of 800 numbers from a text file.I have to read the sequence of 800 integers, which I store in an array, and then pass half of them to a child, and the other half to the second child of the parent class. I have to do this until only 100 numbers are left in each child. When I have reached this the numbers must be sorted, which I am doing using a bubble sort.Once these are sorted the must be returned to the parent processes and merged creating one sequence of sorted numbers. The final sequence must be stored in a file. The splitting of the parent must be done using fork(). I have no idea how to manipulate the parent and child relationship to do splitting and then once again merging. I am not looking for an answer but help on how to do this anything would be great.
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.