Hello everyone,
I need to design a parallel merge sort (merge sort algorithm) that operates using threads as follows:
In the first recursion level (merging two arrays of half the size), one thread is used.
In the second recursion level (two merges of two arrays, each a quarter of the size), two threads are used.
In the third recursion level (four merges of two arrays, each an eighth of the size), four threads are used.
And so on.
I must use the threading library and synchronization mechanisms such as mutex and semaphore as needed.
I tried to use chat gpt but I fell like all the answers are wrong.
I will be greatfu for help.
Joe.
I need to design a parallel merge sort (merge sort algorithm) that operates using threads as follows:
In the first recursion level (merging two arrays of half the size), one thread is used.
In the second recursion level (two merges of two arrays, each a quarter of the size), two threads are used.
In the third recursion level (four merges of two arrays, each an eighth of the size), four threads are used.
And so on.
I must use the threading library and synchronization mechanisms such as mutex and semaphore as needed.
I tried to use chat gpt but I fell like all the answers are wrong.
I will be greatfu for help.
Joe.