3 parts, 3 steps a) list of unique ints b) array of objects c) sort the list Must do A before B and B before C - only submit excellent code, stop when you can't - non-working code cancels out all...

1 answer below »

3 parts, 3 steps  a) list of unique ints b) array of objects c) sort the list  Must do A before B and B before C  - only submit excellent code, stop when you can't  - non-working code cancels out all prior versions    List of unique integers    - command line N, R    - generate N numbers in the range 1 to R    - terminate if not possible    - fill & print list otherwise    - time it  100,100 500,500 1000,1000 20000,20000  40000,40000  ./dfree  10 20    10 numbers in range 1 to 20, no dups    or print "impossible"  Random values;  but do set a seed so you can get repeatable    Create a class; each object has at least the 5 attributes  Now handle an array of these objects  Array of objects  ( like array of structures )   int key  [ unique ]   int m   string of m random chars   int n   list of n numbers  perhaps m,n sent to constructor   but have default as well     Now sort the data. Measure it.   Bubble sort & Selection sort  ( by key )   * size of list           [ 1000    50000 ]   * values m,n             [small 10   med 100   large 1000]                            -- develop good test cases  Arrays & lists should be dynamic, right-sized  print 1st & last 3  [ key, 4 chars, 3 ints ] time it


Answered 1 days AfterApr 30, 2021

Answer To: 3 parts, 3 steps a) list of unique ints b) array of objects c) sort the list Must do A before B and...

Kshitij answered on May 01 2021
148 Votes
c++ 3 parts/1st.cpp
c++ 3 parts/1st.cpp
# include
# include
# includelimits>
# include
using namespace std;
int main() {
    long long int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        long long int number = rand() % n + 1;
        cout << number << " ";
    }
    return 0;
}
c++ 3 parts/2.cpp
c++ 3...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here