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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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