Given very large array of integers, find maximum within the array using multhreading.
Input : 1, 5, 7, 10, 12, 14, 15, 18, 20, 22, 25, 27, 30, 64, 110, 220 Output :Maximun Element is : 220 Input : 10, 50, 70, 100, 120, 140, 150, 180, 200, 220, 250, 270, 300, 640, 110, 220 Output : Maximun Element is : 640
Prerequisite : Multithreading
Note : Useful in large files of size MB/GB.
How to run :
It can only be run on linux envirenment.
>> gcc -pthread maximum.c >> ./a.out
Maximun Element is : 300
- Print numbers in sequence using thread synchronization
- Conditional wait and signal in multi-threading
- Linear search using Multi-threading
- C++ | Nested Ternary Operator
- Working of Keyword long in C programming
- Code valid in both C and C++ but produce different output
- Different ways to Initialize all members of an array to the same value in C
- Why does sizeof(x++) not increment x in C?
- C program to find the length of a string
- C Program to Multiply two Floating Point Numbers
- C Program to Compute Quotient and Remainder
- C program to Find the Largest Number Among Three Numbers
- C program to find the size of int, float, double and char
- C program to Check Whether a Number is Positive or Negative or Zero
- Inter-process Communication using a shared stack
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.