it has been a while I worked anything in pseudo code.
Let a ∈ A
A := A \ { a }
Can you tell me, specifically what this part is -> A := A \ { a } a should be the set members, so a pair?
CodePudding user response:
Initialize all items of the array X by -1
For at most m steps:
- Pick a number from the
set Aand keep it in the variablea - Remove
afrom theset A - Calculate
r = a mod n(remainder ofa / n) - If
X[r] = -1(there is noasuch thatr = a mod nbefore), then setX[r] = a, Else, (there wasasuch thatr = a mod nbefore) so return thepair (X[r], a)which both have the same remainder respect withn.
