Taxidriver
Programmer
Hello, I have a code that, given n segments in input, randomizes their order. The segments are stored in a linked list. Every element of the list is swapped with a random element calculated with the function rand(). the problem is that every time I run the program, the function rand() returns always the same numbers, in the same order! For example, 4 segments are always permuted following the sequence 1-3-2-0.
How can I have a better randomization?
thanks.
How can I have a better randomization?
thanks.