Given a list of integers find the minimum and maximum

Assignment Help JAVA Programming
Reference no: EM132109225

Process Communication

Problem 1

Problem: Given a list of integers find the Minimum, Maximum, and the Sum of the numbers. The list will be in a text file you generate. You may use any form of interprocess communication (IPC) to partition the file/array into chunks and distribute work to more than one processes (if there are multiple ones) (e.g., pipes, shared memory, or additional (perhaps more sophisticated) inherent process system calls).

Input Format:

Input will be in a text file. Each integer will be separated by a newline character (\n).

Exp:

100

20

35

Output Format: You should print out the results in a text file. Every process that is created should print out their own process id and their parent's process id. Then once you have computed the final max, min, and sum, you will print those out. Please follow this format:

Hi I'm process 2 and my parent is 1.

Hi I'm process 3 and my parent is 2.

Hi I'm process 4 and my parent is 2.

Max=50

Min=1

Sum=371

Part A: Write a program to answer this problem using only one process.

Part B: Write a program to answer this problem using multiple processes where each process spawns at most one process. (Like DFS)

Part C: Write a program to answer this problem using multiple processes where the first process spawns all other processes. (Like BFS)

Part D: Write a program to answer this problem using multiple processes where the first process spawns multiple processes and they spawn their own multiple processes. Your ultimate goal should be to produce such a hierarchy of processes so that performance compared to parts B and C, is optimized. (So basically this should be a combination of structures of Part B + Part C)

Extra Credit: Record the time it takes for each of the programs to run and comment on your observations. Try it on lists of size 10,100,1k,10k,100k.

Hint: You should first load the file into an array then start working on the data.

What to turn in:

C files for each problem

A makefile in order to run your programs.

Input text file (your test case)

Output text file (for your test case)

Report: Explain design decisions (fewer vs. more processes, process structure, etc.). Give one thing you have learned. Include the extra credit observation in this report.

Reference no: EM132109225

Questions Cloud

Identify and elaborate processes from pmbok : project manager in charge of delivering such as an important world sporting event - In what ways would you have implemented lean project management for event
What is the cidr notation for the network id now : Starting with the network ID 192.16.20.0/24, what is the default Class C subnet mask for this network? Write this information both in decimal and in binary.
Compute the area and circumference of the circle : Write a C++ program that inputs the radius of a circle and then computes the area and circumference of the circle using the formua.
What is the network id of this subnet : What is the network ID of this subnet? What is the CIDR notation for this subnet? What is the broadcast address?
Given a list of integers find the minimum and maximum : Write a program to answer this problem using multiple processes where the first process spawns multiple processes and they spawn their own multiple processes.
Demonstrate the class with a driver program : In a course, a teacher gives the following tests and assignments: A lab activity that is observed by the teacher and assigned a numeric score.
Write a simple pyhone program to encrypt and decrypt : Write a simple pyhone program to encrypt and decrypt a file using AES algorithm (key value: " security").
Evaluate the proposed system : Propose a suitable information system solution that meets the chosen company needs - Evaluate the proposed system and provide your recommendations
State your reasons of the configuration and the cost : In this project, you are going to build up your own computer from scratch. In general, you will have a budget of $1500. You can "buy" items from ANYWHERE.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Print out the stock with the highest profit if sold

After the table is displayed, print out the stock with the highest profit if sold and its position in the array[row][column].

  Write a program that asks user how many students to process

Write a program that asks the user how many students to process (must be at least 1, but no more than 20) and then reads in the scores for three items, an exam average score (double number), lab average score (double number) and homework average s..

  Implement a method that compares two rectangles

Implement the compare method of the class RectangleComparator. The method compares two rectangles.

  Write a java program that simulates a handheld calculator

Write a Java program that simulates a handheld calculator. Your program should be able process input, either in a GUI or from the Java console.

  Write an algorithm method for telling if l and m store

Write an algorithm method for telling if L and M store the same sequence of elements (but perhaps with different starting points)

  Looking for help setting-up a java class

Looking for help setting-up a Java class, with the following requirements:

  Special car rental code from the license plate

When you rent a car from an agency, the key ring has several pieces of information: license plate, make and year of car, and usually a special code. This code could be used for some data processing within the company's computers. This lab will practi..

  Fill a bag with the keywords of the java language

Create a class bag (multiset) that uses an expandable array to store the bag items. The item type must be a Java String type; that is, the bag will store strings of characters. The class should have the methods listed below. Create a main class to te..

  What aspects of judaism are rejected or reinterpreted

What theology does Jesus present in the two excerpts from the Gospels that are a part of the readings? What aspects of Judaism are strongly represented? What aspects of Judaism are rejected or reinterpreted?

  Describe the differences between relative and linear layouts

Describe the differences between relative and linear layouts. Why are .png files the preferred type of image resource for the Android device? Write a paragraph that gives at least three reasons.

  Write a program that implements an atm machine

This project involves writing a program that implements an ATM machine. The interface to the program should be a Java GUI.

  Write a java program to accept a day number

Write a Java program to accept a day number from the user and display the corresponding day name by using the if/else construct. Rewrite the program using the switch case construct

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd