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
If a hacker can steal your passwords by installing malware that captures all the messages you type, what kind of malware did the
Free_Kalibri [48]
Keylogger, or Spyware
4 0
3 years ago
Read 2 more answers
What is the purpose of the SMTP command "HELO"
sergij07 [2.7K]
If a client initiates the SMTP communication using an EHLO (Extended Hello) command instead of the HELO command some additional SMTP commands are often available. They are often referred to as Extended SMTP (ESMTP) commands or SMTP service extensions. Every server can have its own set of extended SMTP commands.
4 0
3 years ago
You just finished training a decision tree for spam classification, and it is gettingabnormally bad performance on both your tra
strojnjashka [21]

Answer:

Option B is the correct option.

Explanation:

The following answer is true because when the person completed our training of a decision tree and after the following presentation he getting not good working performance on both side i.e., test sets and during the training period. After the training there is no bug on the implementation of the presentation then, he has to increase the rate of the learning.

5 0
3 years ago
CB workorder
elena-14-01-66 [18.8K]
The late seventeenth-century literary period known as the Restoration begins in 1660, the year in which the monarchy (and specifically, King Charles II) was restored to the English throne.
3 0
3 years ago
PLZZ HELP!!!
Serga [27]

Answer:

I don't know

Explanation:

with data you can access all things in the world

8 0
3 years ago
Other questions:
  • In 2–3 sentences, describe how you would insert a table into a word-processing document.
    9·2 answers
  • Consider the helicopter of Example 2.1, but with a slightly different definition of the input and output. Suppose that, as in th
    6·1 answer
  • 1. Given two numbers, n and k ( 0&lt; n, k &lt;=12), generate all the pemutations taking k letters from n letters (nPk) consider
    5·1 answer
  • Which version of Windows was considered an operating environment rather than an operating system? Windows 1.0 Windows 3.0 Window
    9·1 answer
  • Please help again if anyone doesn't mind
    15·1 answer
  • Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both sing
    10·1 answer
  • how many bits must be flipped (i.e. changed from 0 to 1 or from 1 to 0) in order to capitalize a lowercase 'a' that’s represente
    5·1 answer
  • A user input is when the user interacts with the program by typing.<br> True<br> False
    11·2 answers
  • Write the following function without using the C++ string class or any functions in the standard library, including strlen(). Yo
    5·1 answer
  • Why do we need operating systems?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!