Generating 100k to 1 million unique random numbers

Hey guys,

I need your help. Do you have any advice on how to generate 100k to 1 million unique random numbers, relatively fast? I have an assignment to compare the times needed to search for a record in a binary search tree (stored in in a file) and normal file. Each record has a key that is generated on random. Since the binary search tree uses that key for sorting data, it needs to be unique. I also need a large number of records, otherwise the search times will not be noticeable (they need to be expressed in miliseconds).

I've tried various ways to generate such a large number of unique random numbers and the maximum that I managed to accomplish is around 110 000.