prompt Sunday, September 5, 2021 9.5 hw1 part 2 CompanyTracker struct Company{ Company *parent; //parent in company, or nullptr if it has no parent Company *merge1, *merge2;//the sub-companies merged...

complete c++ skeleton code and implement that data structure specified


prompt Sunday, September 5, 2021 9.5 hw1 part 2 CompanyTracker struct Company{ Company *parent; //parent in company, or nullptr if it has no parent Company *merge1, *merge2;//the sub-companies merged to obtain this comp Company( ) : parent(nullptr), merge1(nullptr), merge2(nullptr) { } Company(Company *m1, Company *m2) : parent(nullptr), merge1(m1), merge2(m2) { } }; class CompanyTracker{ public: CompanyTracker(int n); ~CompanyTracker(); void merge( int i, int j); void split( int i); bool inSameCompany( int i, int j); private: int numCompanies; Company** companies; //array of pointers to all 1-person companies //allocated in constructor, will not contain the merged companies [ [ 0 company point], [1] , [2], [3], [4] ] Company* largestCompany (const Company& ) { } 1
Sep 05, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here