Computer Science, asked by rohithsingaravelu, 19 days ago

Write a Java program to sort the numbers in ascending and descending order at the same time using separate threads. You need to create two child threads with priority 8 using Runnable interface. The program should include a RanGen function that allows to populate the array using random function. The program should also scrutinize for Illegal exceptions that maybe invoked as through separate functions for managing overflow and underflow conditions. For sorting in ascending order, the program can take the help of Quicksort using Lomuta approach and for descending it can take the help of Insertion sort. Your output should also publish the thread executing currently

Answers

Answered by aryan6rajak735223
0

Answer:

Multi-threading means multiple flow of control. Multi-threading programming is a conceptual paradigm for programming where one can divide a program into two or more processes which can be run in parallel. There are two main advantages of multi-threading : Fist, program with multiple threads will, in general, result in better utilization of system resources, including the CPU, because another line of execution can grab the CPU when one line of execution is blocked. Second, there are several problems better solved by multiple threads. For example, we can easily write a multi-threaded program to show animation, play music, display documents, and down load files from the network at the same time.

Java is a multi-threaded language. Java allows to write a program where more than one processes can be executed concurrently within the single program. Java's threads are often referred to as light weight threads, which means that they run in the same memory space. Because Java threads run in the same memory space, they can easily communicate among themselves because an object in one thread can call a method in another thread without any overhead from the operating system. In this Tutorial we will learn how to do multi-threaded

Explanation:

mark me as a brainlest

Similar questions