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
Thepotemich [5.8K]
3 years ago
8

Anyone understand coding? Please Help! Thank you! :)

Computers and Technology
1 answer:
Damm [24]3 years ago
7 0
Coding is like doing somethin i already know but look u can search it up in Google trust me
You might be interested in
Suppose you have two arrays of ints, arr1 and arr2, each containing ints that are sorted in ascending order. Write a static meth
telo118 [61]
Since both arrays are already sorted, that means that the first int of one of the arrays will be smaller than all the ints that come after it in the same array. We also know that if the first int of arr1 is smaller than the first int of arr2, then by the same logic, the first int of arr1 is smaller than all the ints in arr2 since arr2 is also sorted.

public static int[] merge(int[] arr1, int[] arr2) {
int i = 0; //current index of arr1
int j = 0; //current index of arr2
int[] result = new int[arr1.length+arr2.length]
while(i < arr1.length && j < arr2.length) {
result[i+j] = Math.min(arr1[i], arr2[j]);
if(arr1[i] < arr2[j]) {
i++;
} else {
j++;
}
}
boolean isArr1 = i+1 < arr1.length;
for(int index = isArr1 ? i : j; index < isArr1 ? arr1.length : arr2.length; index++) {
result[i+j+index] = isArr1 ? arr1[index] : arr2[index]
}
return result;
}


So this implementation is kind of confusing, but it's the first way I thought to do it so I ran with it. There is probably an easier way, but that's the beauty of programming.

A quick explanation:

We first loop through the arrays comparing the first elements of each array, adding whichever is the smallest to the result array. Each time we do so, we increment the index value (i or j) for the array that had the smaller number. Now the next time we are comparing the NEXT element in that array to the PREVIOUS element of the other array. We do this until we reach the end of either arr1 or arr2 so that we don't get an out of bounds exception.

The second step in our method is to tack on the remaining integers to the resulting array. We need to do this because when we reach the end of one array, there will still be at least one more integer in the other array. The boolean isArr1 is telling us whether arr1 is the array with leftovers. If so, we loop through the remaining indices of arr1 and add them to the result. Otherwise, we do the same for arr2. All of this is done using ternary operations to determine which array to use, but if we wanted to we could split the code into two for loops using an if statement.


4 0
3 years ago
Sending a busy manager a long email represents a problem in which area of the communication process
FromTheMoon [43]
Time management,they wouldn’t have enough time to read it and they would become more stressed out
3 0
3 years ago
what are the advantages of breaking up a single logical message into a number of fixed-sized packets and then sending each one o
aleksklad [387]

Explanation:

These are the advantages of breaking up a single logical message into a number of fixed sized packets.

- When messages are broken into packets it increases the performance and also the reliability of the internet

- if there is an error in a single packet, this error is not going to affect the entire message.

- the efficiency of the communication line in the internet is improved.

- there is a reduction of traffic. Each packet in a single message can be transmitted through different routes.

- It reduces idleness as each packet can send from different program so each program has a service.

8 0
2 years ago
What is the e-file rejection error for an Invalid bank account or routing transit numbers?
dezoksy [38]
Usually when you encounter the problem you see the error code number "0019" for an invalid bank account or routing transit numbers.

Accounting information is the subject to which this is categorized. As soon as the IRS or (Internal Revenue Service) suspects any error, it will deny the return immediately. 
3 0
3 years ago
What amount of memory enough to store alatter of the alphabet or store a small number​
laiz [17]

Answer:

It can be "ON" or "OFF". So it can store the numbers 1 and 0, but it certainly doesn't have the capacity to store a letter of the alphabet.

Explanation:

3 0
2 years ago
Other questions:
  • How must you rect to a flashing<br> Yellow traffic light?
    9·1 answer
  • Don't pat any attention to this
    7·2 answers
  • Help please brainliest
    8·1 answer
  • 2. What is the layout of the modern keyboard known as?
    13·1 answer
  • Which one of the following business names would be rated Incorrect for name accuracy? Answer McDonald's McDonald's H&amp;M McDon
    14·1 answer
  • Direct Mapped Cache. Memory is byte addressable. Fill in the missing fields based upon the properties of a direct-mapped cache.
    6·1 answer
  • What is a benefit of the Name Manager feature?​
    12·2 answers
  • Jamal wants to create a program that will play music during the afternoon. Which kind of loop should be used in the program?
    6·2 answers
  • 1- pensamiento sistémico<br>2- visión oriental y occidental​
    8·1 answer
  • Hey everyone please let my friends answer please?????? .
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!