I'm currently studying Algorithms in which I need to find both deterministic and randomized algorithms for the same problem.
So, the input for the algorithm is a finite set of value pairs something like below
[(a,b),(b,c),(c,d),(d,e)................]
If I'm looping through the above array and inserting each set(a,b) into a standard hashmap with key = a
and Value = b
, and use it derive the solution. Does that make my algorithm randomized?
I'm confused because one of the TA's for the course said it will make this case for randomized algorithms.
The example given in the CLRS(Hiring problem) to introduce the concept Randomized algorithm, randomizes the input data before accessing the input.
Does using a hashmap to store the input data makes it come under the category of a randomized algorithm? If yes, how?
Aucun commentaire:
Enregistrer un commentaire