title: Which of these algorithm is better in performance and order for generating N unique random number in 1..n range?
body: <h2>1</h2>
  
  <p>Take an array of n elements: { 1, 2, 3, .... n }. Shuffle the array using any of the standard algorithms of randomly shuffling arrays. The first N elements of the modified array is what you are looking for.</p>
  
  <h2>2</h2>
  
  <p>Simply use <code>Random.Next()</code> in a loop and check if it already exists or not in an <code>Dictionary</code>, until we have N numbers.</p>
  
  <p>Notice that N &lt;&lt; n ( N is very smaller than n)</p>