Question: 1 You have an idea about implementing arrays in your own programming language! In your language, an array is introduced like this: anytype anytypearray[]; After

1 You have an idea about implementing arrays in your own programming language! In your language, an array is introduced like this:

anytype anytypearray[];

After that, any index operation is ok:

anytypearray[y] = x; //for example anytypearray[100] = 1;

If anytypearray is large enough to contain index y, x is placed there. If it is not large enough, your implementation makes it bigger.

a) What is the worst case time complexity of anytypearray[y] = x;

b) What is the time complexity introducing an array variable, like: anytype anytypearray[];

c) What kind of problem will arise with this: anytype x = anytypearray[y]; ?

2. What is counting sort? How would a counting sort sort this array: [7,4,1,4,8,2] ? What is the time complexity?

note: I need all answer related to the course data structure 1 and coding on c++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!