Hi, I am trying to solve the below question.
How to generate an array of unique values without using randomize method or rand.
Please help me with the solution.
Thanks,
Sruthi.
Hi, I am trying to solve the below question.
How to generate an array of unique values without using randomize method or rand.
Please help me with the solution.
Thanks,
Sruthi.
In reply to sruthikrapa:
This appears to be a homework question based on the fact you have used randomize() in your other questions. So I’ll help but not give you a solution
What you need to do create a loop that generate a random value and pushes it onto a queue. Before pushing the value into the queue, you need to check if the value does not already exist inside the queue. If it does , you need to generate a new random value and try again.
In reply to sruthikrapa:
You could: