Question
Download Solution PDFThe following multithreaded algorithm computes transpose of a matrix in parallel:
p Trans (X, Y, N)
if N = 1
then Y[1, 1] ← X [1, 1]
else partition X into four (N/2) × (N/2) submatrices X11, X12, X21, X22
partition Y into four (N/2) × (N/2) submatrices Y11, Y12, Y21, Y22
spawn p Trans (X11, Y11, N/2)
spawn p Trans (X12, Y12, N/2)
spawn p Trans (X21, Y21, N/2)
spawn p Trans (X22, Y22, N/2)
What is the asymptotic parallelism of the algorithm?
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFDuring transpose of the matrix, it is partitioned into 4 submatrices of size N/2.
If n = 1, then T(1) = 1
Else T1(n) = 4T1(N/2) + O(1) ----- (1)
Solving equation 1 by master’s theorem:
\({n^{log_b^a}} = \;{n^{log_2^4}} = {n^2}\), here a= 4 and b = 2
So, T1(n) = O(N2)
But the algorithm is multithreaded, and transposing is going in parallel. And we solved one subproblem already.
So, Tn(N) = Tn(N/2) + O(1)
Tn(N) becomes O(log N)
asymptotic parallelism of the algorithm:
T1/T∞ or θ (N2/lg N)
Last updated on Jun 6, 2025
-> The UGC NET Exam Schedule 2025 for June has been released on its official website.
-> The UGC NET Application Correction Window 2025 is available from 14th May to 15th May 2025.
-> The UGC NET 2025 online application form submission closed on 12th May 2025.
-> The June 2025 Exam will be conducted from 21st June to 30th June 2025
-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.
-> The exam is conducted bi-annually - in June and December cycles.
-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions.
-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.