How to Generate Random Array of Unduplicated Values and Sort in Ascending Order

Updated Oct 29, 2018

Issue Details

How to generate random array of unduplicated values and sort in ascending order?

Solution

1. Initialize array
2. Generate a random element according the specified range
3. determine if the element exists in this array
4. if the element does not exists in this array, add it in this array
5. determine if the array size meet the requirement
6. display this array
7. return a sorted version of array in ascending order 
See more details in figure 1
 
Figure 1

WAS THIS ARTICLE HELPFUL?

Not Helpful