- Notifications
You must be signed in to change notification settings - Fork0
alokkusingh/number-processor
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The application accepts numbers and does multiple computation on the numbers inparallel or insequential.
Created byAlok Singh
Addition- add the numbersMultiplication- multiply the numbersSubtraction- subtract the numbers
Example 1:
Sample Input:1 1 1 1 1 SEQUENTIAL
Sample Output:ERROR: "At least 2 numbers must be different"
Explanation: All five numbers are with the same value "1".
Example 2:
Sample Input:3 4 1 5 6 SEQUENTIAL
Sample Output:Add: 19Multi: 360Sub: -7Time: 10sType: SEQUENTIALNumbers: [6, 5, 4, 3, 1]
Explanation: in this case, Add operation executed first and took 2s. Then Mult operation executed and took 5s. Finally Sub operation took 3s, giving a total of 10s.
Example 3:
Sample Input:5 4 5 5 5 PARALLEL
Sample Output:Mult: 20Sub: 1Add: 9Time: 5sType: PARALLELNumbers: [5, 4]
Explanation: in this case, Add (5s), Mult (1s) and Sub (4s) operations started at the same time and the longest one defined the final execution time result of 5s.
Run the application by executing following command
cd number-processorjava -jar target/number-processor-1.0.0.jar 1 2 6 4 3 PARALLELOr
cd number-processorjava -jar target/number-processor-1.0.0.jar 1 2 6 4 3 SEQUENTIALGet the latest build fromnumber-processor
Build Docker Image
cd number-processordocker build -t alokkusingh/number-processor:latest -t alokkusingh/number-processor:1.0.0 --build-arg JAR_FILE=target/number-processor-1.0.0.jar .Pull/Run Docker Container
docker run --rm --name number-processor alokkusingh/number-processor 1 2 6 4 3 SEQUENTIALAbout
Number Processor
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.