Jump to content

Parallel Algorithms: Difference between revisions

Line 716: Line 716:
===Removing duplicates in an array===
===Removing duplicates in an array===
Assume you have an Arbitrary CRCW
Assume you have an Arbitrary CRCW
* Given array A of size n with entries 0 to n-1
# Given array A of size n with entries 0 to n-1
* For each entry pardo
# For each entry pardo
** Write B[A[i]] == i
** Write B[A[i]] == i
** Only one write will succeed for each unique A[i]
** Only one write will succeed for each unique A[i]