When I try to generate random values for various sorting algorithm to gprof them and compare the results, I noticed the random() function was creating same values within an instance and in same order. Is there a way to get rid of it?
Example I tried profiling bubble sort and so randomly created 10000 values and bubble sorted it, now again when I give 10000 values its generating same set of values as before and in the same order.
When I changed the value to 1000 the first 1000 values of previous test were exactly same as this case. I changed the range of values with different possibilities like only positive integers and both positive, negative integers. What is the reason random() function is generating same values? And is there a way to fix it?