Hi there, I am making a sort program (insert sort) that takes a vector list of random, increasing, and decreasing integers. I got the random list working with the rand() command which was pretty easy, but I am having a hard time getting the list to have a pre-sorted increasing and another list with decreasing order.
(I am basically going to compare the work done / cpu clock tick between the three sequences after I get all three running)
I mean I can make a list with 20000 numbers in there and pass it into the vector but that would take forever.
Here's my random list that works great:
Any help is appreciated for modifying this to have an increasing and/or decreasing integer sequence instead.
(I am basically going to compare the work done / cpu clock tick between the three sequences after I get all three running)
I mean I can make a list with 20000 numbers in there and pass it into the vector but that would take forever.
Here's my random list that works great:
Code:
srand(time(0));
int n = 20000;
int nums[n];
for (int i=0; i<n; i++){
nums[i]=rand()%100;
cout<<nums[i]<<" ";
Any help is appreciated for modifying this to have an increasing and/or decreasing integer sequence instead.