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
Harlamova29_29 [7]
3 years ago
9

RrayList Mystery Consider the following method:

Computers and Technology
1 answer:
Oksana_A [137]3 years ago
5 0

Answer:

a)

int: [10, 20, 10, 5]

out: [0, 10, 20, 10]

b)

int: [8, 2, 9, 7, -1, 55]

out: [0, 0, 8, 9, -1, 55]

c)

int: [0, 16, 9, 1, 64, 25, 25, 14]

out: [0, 0, 0, 0, 16, 9, 64, 25]

Explanation:

What the code is doing is changing the list if and only if the item number i, where i is an odd position on the list, is greater than the item number i-1. If the condition mentioned is satisfied, the element number i is removed, and a zero is added to the beginning of the list; this is why the dimension of the input is equal to the output (for every element removed a zero is added).

Note:

  • The first item of a list is the item 0
  • .add method can receive two parameters the first indicating the position where the element will be added and the second the element to be added.
  • .get method allows you to select any element on the list by its index.
  • .size method gives you the size of the list
  • In the for loop i += 2 indicates an increment of two, since we start with i = 1 we are going to iterate through odd numbers i = 1,3,5,7...

 

You might be interested in
Your grandmother was an established artist and left you several original paintings after she died. Which of these statements is
Andreyy89
it's the first one, lasts for life plus 70 years.
7 0
4 years ago
Select which is true for for loop​
uranmaximum [27]

Answer:

i dont understand what you mean and what you are asking in the qestion

Explanation:

7 0
3 years ago
______ provide visual representations of the options available for a given command
anygoal [31]

The visual representations is provided by the Gallery in the computer system.

Basically, gallery means the collection of pictures in a Computer.

  • Gallery is what enables systematic display and the management of distinct images in the computer.

  • A very good illustration is use of Clipart images. It is a ready made picture gallery available in the computer.

  • Every function on computer are represented with an icon, the icon images are enable through the Gallery.

In conclusion, the Visual representations of the options available for a given command is provided by the Gallery.

Read more about Gallery here

<em>brainly.com/question/2946480</em>

5 0
3 years ago
1. What are the benefits and drawbacks of keeping separate journals for individual accounts?​
astraxan [27]

Answer:

these are some benefits Keep track of multiple areas of interest. If you want to write extensively about your day-to-day life, your exercise goals, the movies you see, and the places you visit, you might feel more organized if you have a separate place to write about each topic.

3 0
4 years ago
Why can videos be streamed from the cloud to a computer with no loss in
mezya [45]
I think the answer is B
3 0
3 years ago
Read 2 more answers
Other questions:
  • Helen has no experience in security. She would like to earn a certification that demonstrates that she has the basic knowledge n
    15·1 answer
  • The ____ layer protocols are the rules for implementing end-user services provided by a network. Transport Application Physical
    11·1 answer
  • How can the output of a command be redirected to a file instead of being displayed on the computer's screen?
    9·1 answer
  • Compressing a file is also called
    9·2 answers
  • You use ddl to create, modify, and delete the ___________________________ of a database.
    6·1 answer
  • Which of the following was (and still is) used by computer programmers as a first test program?
    13·2 answers
  • What is a query? State it's uses.​
    8·1 answer
  • What is the grooming process as it relates to online predators
    9·1 answer
  • The television is the biggest technological advancement in communication since the telephone.
    6·2 answers
  • USPS stuck on "We are preparing your order for shipment" for 3 days. What does this mean?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!