Skip to content

πŸ“‚ Technologies of distributed systems and parallel computing | Lab 1 | Find Most Frequent Element | Java program that calculates the most frequent element in an array of integers using both serial and parallel algorithms.

Notifications You must be signed in to change notification settings

neprostostas/frequent-value-identifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Technologies of distributed systems and parallel computing

Lab 1 | Find Most Frequent Element

This is a Java program that calculates the most frequent element in an array of integers using both serial and parallel algorithms.

πŸ‘» Author

Created by Stanislav Kinash / neprostostas

πŸš€ Quick Start Guide

Running the Program

To run the program, open a command prompt or terminal window and navigate to the directory containing the Main.java and WorkerThread.java files. Then, compile the source code using the following command:

javac Main.java

Once the code is compiled, you can run the program using the following command:

java Main

Options

When you run the program, you will be presented with the following options:

  1. Generate random input data
  2. Read input data from file (input.txt)

If you choose option 1, you will be prompted to enter the size of the array you wish to generate. The array will then be written to a file called input.txt.

If you choose option 2, the program will attempt to read an array from a file called input.txt. If the file does not exist, option 2 will be unavailable.

After the input data has been generated or read, the program will calculate the most frequent element using both a serial algorithm and a parallel algorithm. The results will be displayed on the screen along with the time taken to perform each calculation.

Finally, you will be prompted to run the program again or exit.

✨ Features

  • Generates random input data or reads input data from a file
  • Calculates the most frequent element using a serial algorithm
  • Calculates the most frequent element using a parallel algorithm
  • Displays the time taken to calculate the most frequent element for both algorithms
  • Allows the user to run the program multiple times or exit after each run
  • Supports Windows and Unix-based operating systems

🀝 Contributing

Contributions, issues, and feature requests are welcome!

πŸ“ License

This program is licensed under the terms of the MIT License. See the LICENSE file for more information.

πŸ“« Contact

If you have any questions or concerns, please contact the author at [email protected]

About

πŸ“‚ Technologies of distributed systems and parallel computing | Lab 1 | Find Most Frequent Element | Java program that calculates the most frequent element in an array of integers using both serial and parallel algorithms.

Topics

Resources

Stars

Watchers

Forks

Languages