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
Which code will allow Joe to print Coding is fun. on the screen? print("Coding is fun.") print(Coding is fun.) print = (Coding i
ludmilkaskok [199]

Answer:

print(“Coding is fun.”)

Explanation:

The proper format for a print statement is usually you have the print statement followed by the string in quotes in parentheses.

Hope this helped!

7 0
3 years ago
Read 2 more answers
When citing an Internet source:__________. a. it is ok to omit quotation marks if you change some words in the original sentence
ludmilkaskok [199]

Answer:

c. it is ok to omit quotation marks for a paraphrase of the source.

Explanation:

Plagiarism can be defined as the act of representing or using an author's work, ideas, thoughts, language, or expressions without their consent, acknowledgement or authorization.

In order to avoid plagiarism, it is very important and necessary to reference or cite the source of the informations and data.

However, when citing an Internet source, it is ok to omit quotation marks for a paraphrase of the source because the idea, thoughts or intellectual work as being rephrased.

3 0
3 years ago
Nonverbal messages from the movie it​
RUDIKE [14]

Answer:

ya you say right

Explanation:

5 0
3 years ago
Read 2 more answers
You are working on a project and need to be able to access the content from home and share the files with other team members. Th
inn [45]
Local server so you can all you use if you guys are near
5 0
3 years ago
Read 2 more answers
Design and implement an algorithm that gets as input a list of k integer values N1, N2,..., Nk as well as a special value SUM. Y
satela [25.4K]

Answer:

Follows are the code to this question:

def FindPair(Values,SUM):#defining a method FindPair  

   found=False;#defining a boolean variable found

   for i in Values:#defining loop for check Value  

       for j in Values:#defining loop for check Value

           if (i+j ==SUM):#defining if block that check i+j=sum

               found=True;#assign value True in boolean variable

               x=i;#defining a variable x that holds i value

               y=j;#defining a variable x that holds j value

               break;#use break keyword

       if(found==True):#defining if block that checks found equal to True

           print("(",x,",",y,")");#print value

       else:#defining else block

           print("Sorry there is no such pair of values.");#print message

Values=[3,8,13,2,17,18,10];#defining a list and assign Values

SUM=20;#defining SUM variable

FindPair(Values,SUM);#calling a method FindPair

Output:

please find the attachment:

Explanation:

In the above python code a method, "FindPair" is defined, which accepts a "list and SUM" variable in its parameter, inside the method "found" a boolean variable is defined, that holds a value "false".

  • Inside the method, two for loop is defined, that holds list element value, and in if block, it checks its added value is equal to the SUM. If the condition is true, it changes the boolean variable value and defines the "x,y" variable, that holds its value.
  • In the next if the block, it checks the boolean variable value, if the condition is true, it will print the "x,y" value, otherwise, it will print a message.  

6 0
3 years ago
Other questions:
  • You have been asked to create an authentication security plan for your company. Which of the following components would you inco
    14·1 answer
  • _____________ is a service that provides access to hardware resources available over the Internet.
    11·1 answer
  • It is better to know the main components of all computer programming languages
    9·1 answer
  • A write once, read many (worm) disc is a common type of _____.
    6·1 answer
  • Ok so this question is kinda weird but does anyone know what google drive is. If so how do you upload a video to it?
    11·2 answers
  • Which examples demonstrate common education and qualifications for Manufacturing Production Process Development careers? Check a
    12·2 answers
  • In 1981, the first digital icons were launched for users in _________, which was the first computer with a GUI operating system.
    12·1 answer
  • Any one know :) please
    9·1 answer
  • What is the difference between the byte and short data types in Java?
    7·1 answer
  • What is the output for this program?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!