1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nalin [4]
3 years ago
15

Suppose that a is declared as an int a[99]. Give the contents of the array after the following two statements are executed: for

(i = 0; i <99 ; i++) a[i] = a[a[i]];
Computers and Technology
1 answer:
mr_godi [17]3 years ago
5 0

Answer:

Each array position holds the position from which the information is going to be retrieved. After the code is run, each position will have the information retrieved from that position.

Explanation:

The best way to solve this problem is working as if we had a very small array. Then we can generalize for the large array.

For example

int a[3];

a[0] = 1; a[1] = 2; a[2] = 0;

for(i = 0; i < 3; i++)

a[i] = a[a[i]];

When i = 0, we have:

a[i] = a[a[i]] = a[a[0]] = a[1] = 2;

When i = 1, we have

a[i] = a[a[i]] = a[a[1]] = a[2] = 0;

When i = 2, we have

a[i] = a[a[i]] = a[a[2]] = a[0] = 1;

Basically, in our small example, each array position holds the index from which we are going to retrieve the information. The same is going to happen in the array of length 99. After the code is run, each position will have the information retrieved from that position

You might be interested in
A small monster collector has captured ten Bagel-type small monsters. Each Bagel-type small monster has a 35% chance of being a
Doss [256]

Answer:

Check the explanation

Explanation:

Each Bagel-type small monster has 0.35 probability of being a Sesame Seed-subtype and 0.2 probability of being a Whole Wheat-subtype.

The probability that exactly 8 of them are Whole Wheat-subtype is \binom{10}{8}(0.2)^8(0.8)^2 using multiplication principle, because first need to choose which 8 are Whole Wheat-subtype, and if exactly 8 of them are Whole Wheat-subtype, then other two are not Whole Wheat-subtype. The former has probability 0.2, while the latter has probability 1-0.2 = 0.8 .

Kindly check the attached images below for the complete answer to the question above

6 0
3 years ago
How many owners does a sole proprietorship have?
never [62]
The sole proprietorship it is the simplist business form under which one can operate a business. the answer is one.
8 0
3 years ago
Create a series called 'directors' that contains each director's name and his or her average rating. Print out the type of your
sasho [114]

Using the computational language in python it is possible to write a code that we will use graphics to organize the names of the directors and the films they made.

<h3>Writing code in python:</h3>

<em>import pandas as pd</em>

<em>df = pd.read_csv('all_data/movie_metadata.csv')</em>

<em>print('Shape: ',df.shape)</em>

<em>df.head()</em>

<em>name = df[['director_name','imdb_score']] </em>

<em>directors = name.groupby(['director_name']).mean() </em>

<em>directors = directors.reset_index() </em>

<em>directors = directors.stack()</em>

<em>print(directors,'\n')</em>

<em>print(type(directors),'\n')</em>

<em>print(directors[directors=='Steven Spielberg'],'\n')</em>

<em>print(directors[102]['imdb_score'])</em>

<em>miyazaki = df[df['director_name'] == 'Hayao Miyazaki']['movie_title']</em>

<em>print(miyazaki)</em>

<em>pivot_agg = pd.pivot_table(df,values='imdb_score', index=['country'], columns=['director_name'],aggfunc=np.median)</em>

<em>pivot_agg</em>

<em>gladiator_duration = df[df['movie_title']=='Gladiator\xa0']['duration'] </em>

<em>gladiator_duration</em>

See more about python at brainly.com/question/18502436

#SPJ1

6 0
2 years ago
If there is a combination of two or more attributes which is being used as the primary key then we call it as
Hunter-Best [27]

Answer:

Composite Keys.

.....Wubba Lubba Dub-Dub :))

5 0
3 years ago
What can help you best learn about appearance, habitats and behaviors of birds in your area
Korvikt [17]

c microbiology textbook

8 0
3 years ago
Other questions:
  • Which word most likely means "a timepiece fitted with a recording device that marks down exact intervals of time"? chronograph c
    9·2 answers
  • Does this look anywhere close to the APA Format?
    6·1 answer
  • How many websites are mobile friendly?
    7·1 answer
  • How we can load program on the browser window.​
    7·2 answers
  • Python is a popular programming language and has been labeled as having a safe core.
    14·1 answer
  • Can you answer this question?
    9·1 answer
  • Mention some of the codes of conduct of Information Technology (IT)​
    11·1 answer
  • The correct banner marking for unclassified documents with cui is
    9·1 answer
  • PLEASE HELP ME WITH MY UNIT TEST!!!!!!!!!!!!!! I'M STRUGGLING AND I AM ESPECIALLY STUCK ON THIS ONE!!!!!!!!!!!!!!!!!!!!!! FOR BR
    7·1 answer
  • What initialization vector (IV) do most weak implementations of the Wireless Equivalency Protocol (WEP) use
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!