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
System memory is on a computer motherboard?
Leya [2.2K]
Is this a true or fales question

8 0
3 years ago
Read 2 more answers
Choose the correct term to complete the sentence.
Andre45 [30]

Answer:

Technology

Explanation:

Edge 2021

8 0
3 years ago
Why should computers have a file structure?
UkoKoshka [18]
I am guessing "A" because you can store code anywhere and file structure does not prevent viruses.

hope this helped
 <span />
4 0
3 years ago
Read 2 more answers
To add an animation to a slide in PowerPoint Online, what is the first step you need to complete?
velikii [3]

To add an animation to a slide in PowerPoint Online, what is the first step you need to complete is to Select the Text object.

<h3>How do you  add animations to text?</h3>

The steps are:

  • Select the object or text that is to be animated.

  • Select Animations and then choose the one that you want.

  • Select Effect Options and then choose the one you want.

Note that To add an animation to a slide in PowerPoint Online, what is the first step you need to complete is to Select the Text object as one needs to choose a slide, select an object before one can add animation.

Learn more about animation from

brainly.com/question/18260878

#SPJ1

6 0
2 years ago
In Java, when a numeric variable is concatenated to a String using the ____, the entire expression becomes a String. a. string s
Anon25 [30]

Answer:

b) Plus sign

Explanation:

The plus sign or addition operator (+) accomplishes concatenation. This is a greatly used in the Java's output Statement to combine values coming from different data types into a formatted output

consider the code snippet below  which uses concatenation to output information about an individual

public class Name {

   public static void main(String[] args) {

   int age =18;

   String name = "John";

       System.out.println("His name is "+name +" and his age is "+age);

   }

}

The + operator has been used to concatenate the int value age and the String value stored in name to the output

5 0
3 years ago
Other questions:
  • In a student​ database, a row that describes the top​ student, including his or her​ lastname, firstname, and​ studentnumber, is
    9·1 answer
  • Why don't we get together to watch the Academy Awards?
    15·2 answers
  • A network administrator is implementing dhcpv6 for the company. the administrator configures a router to send ra messages with m
    6·1 answer
  • 1. To type a capital "C", you would use the ring finger of your left hand.
    15·2 answers
  • Which is the highest level of the hierarchy of needs model?
    7·2 answers
  • 4-One possible performance multiplication enhancement is to do a shift and add instead of an actual multiplication. Since 9 * 6,
    12·1 answer
  • According the Keown book, which Web-based personal financial planning website is known as "the best free way to manage your mone
    6·1 answer
  • Public class Square extends Shape{
    13·1 answer
  • D. DROP
    6·1 answer
  • outline 4 IDE features that makes software development much faster and more convenient than other alternatives.​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!