List the resulting array after each call of the merge method. Indicate the number of character-to-character comparisons made for each call to merge (line 22 of the merge method at the end of the assignment). Sort the following array of characters into alphabetical order: C Q S A X B T.
01 public static void mergesort (char[] a, int i, int r){
02
03 if (1 >= r) {
04 return;
05 }
06 int middle = (1+r)/2;
07 mergesort(a, l, middle);
08 mergesort(a, middle+1, r);
09 merge(a, l, middle, r);
10 }
11
12 public static void merge (char[] a, int i, int m, int r){
13
14 //copy lower half of the array into b
15 char [] b = new char[m-1+1];
16 for (int i = 0; i <= m-1; i++ ) {
17 b[i] = a (1+i);
18 }
19
20 int i = 0, j m+1, k = 1;
21 while (i <= m-1 && j <= r ) {
22 if (a[j] < b[i]) {
23 a[j];
24 k += 1;
25 j += 1;
26 } else {
27 a[k] b[i];
28 k += 1;
29 i += 1;
30 }
31 }
32 while (i <= m-1) {
33 a[k] b[i];
34 k += 1;
35 i += 1;
36 }
37 while ( j <= r ) {
38 a[k] a[j];
39 k += 1;
40 j += 1;
41 }
42 }

Answers

Answer 1

Answer:

40j

Explanation:

the no. divided by one is that no.


Related Questions

AP CSA help needed. Java please.

A child’s parents promised to give the child $10 on her twelfth birthday and double the gift on every subsequent birthday until the gift exceeded $1000. Write a Java program to determine how old the girl will be when the last amount is given, and the total amount she received including the last gift.

Thank you!

Answers

#include using namespace std;int main(){int year = 12,value = 10,total = 0;do{year++;value *= 2;total += value;}while(value*2 < 1000);cout << "Age: " << year << endl;cout << "Last gift: " << value << endl;cout << "Total: " << total << endl;cin.get();return 0;

In java.Find the output of the expressions i) 3 % 4 ii) 3 / 4​

Answers

Answer:

the odd one is 3%4

Explanation:

3% means 3/100 and there is 4beside it

150 komputer terbagi menjadi 4 bagian
a. 50 komputer dept pemasaran
b 30 komputer dep gudang
c 20 komputer dept pengiriman
d 50 komputer dept keuangan

soal
direktur menginginkan laporan dari setiap departement dapat dia akses dalam komputer pribadinya!!
bagaimana caranya

Answers

I’m pretty sure it’s c

What are the letters associated with home rows keys?​

Answers

Answer:

The letters are 'a s d f g h j k l ;' .These are the letters associated with the home keys.

Answer:

In order to maximize the range your two hands can reach on a keyboard, they should be positioned in the middle of the keyboard.Your left fingers should be resting on the letters A,S,D and F.And your right fingers should be resting on the keys J,K,Land semicolon.This set of eight keys is known as home row

HOMEWORK: Bud, Not Buddy I NOTICE... What do you see? chpter 3-4

Answers

Answer:

Check Explanation for Chapter 3 - 4 Summary!

Explanation:

Chapter 3:

Bud tries hard not to panic in the pitch-black darkness of the shed. The eyeballs of three dried-out fish heads stare back at him as he tries the doorknob, which he hopes Mr. Amos only pretended to lock. While deciding where to lay his blanket and pillow, he remembers the story of the cockroach crawling into his best friend’s ear back at the Home. From the story his friend, Bugs, tells, the cockroach was yelling, “My legs! My legs! Why have they done this to my legs?” while adults tried to extract it with tweezers. Bud wants to avoid any encounters with the cockroaches that are surely crawling over the shed’s floor, ready to crawl in his ears. He spreads his blanket on the top of the woodpile and climbs up.

Bud attacks the bat with a rake, only to discover that he has disturbed a hornet’s nest. Hornets sting him as he grabs for the doorknob hoping for escape. In his haste, he forgets about the fish heads with their razor-like teeth. He screams as the teeth cut into him, and the hornets continue to sting. He manages to escape through a window above the wood pile and falls to the ground, slapping at the hornets still attacking him. He heads towards the Amoses’ house, set on revenge.

Chapter 4 Summary:

Bud climbs into the Amoses’ house through an unlocked window. He finds his suitcase still under the kitchen table and puts it on the back porch step. Back in the house, he grabs Mr. Amoses’ shotgun and hides it outside, so if the Amoses wake up, they wouldn’t use it on him.  

Bud returns to the kitchen. He fills a glass with warm water and heads up to Todd’s room. Todd is sound asleep. Bud dips Todd’s fingers in the warm water, hoping he’ll wet his bed. When he doesn’t, Bud pours the water on Todd’s pajama pants, causing Todd to soak his sheets. Bud creeps out of the house, grabs his suitcase, and heads toward the road, now “on the lam ... just like Public Enemy Number One.”

Hope this helps! Let me know if you have any questions! :)

Write a method that accepts an integer argument and returns the sum of all the integers from 1 up to (and including) the number passed as an argument. For example, if 3 is passed as an argument, the method will return the sum of 1+2+3, which is 6. Use recursion to calculate the sum. Test your method in main by prompting the user to enter a positive integer to sum up to. Provide input validation so that only positive values are accepted.

Answers

Answer:

mark me brainlist

Explanation:

import java.util.*;

public class Main {

       public static int sumOfNumbers(int n)

       {

               if(n==0) return 0;

               else

               return n+sumOfNumbers(n-1);

       }

       public static void main(String[] args) {

               Scanner sc=new Scanner(System.in);

               int n;

               while(true)

               {

                       System.out.println("Enter a number :");

                       n=sc.nextInt();

                       if(n<=0)

                       System.out.println("Enter a positive number ");

                       else

                       break;

               }

               System.out.println("Sum of all numbers upto "+n+" is :"+sumOfNumbers(n));

       }

}

how do we use electricity?

Answers

Answer:

People use electricity for lighting, heating, cooling, and refrigeration and for operating appliances, computers, electronics, machinery, and public transportation systems.

Answer:

People use electricity for lighting, heating, cooling, and refrigeration and for operating appliances, computers, electronics, machinery, and public transportation systems.

mark me a brainlist

Define basic logical gates with its symbol, algebraic expression and truth table.​

Answers

Answer:

A truth table is a good way to show the function of a logic gate. It shows the output states for every possible combination of input states. The symbols 0 (false) and 1 (true) are usually used in truth tables. The example truth table shows the inputs and output of an AND gate.

Explanation:

Predicting and controlling the social impact of technology, both anticipating new technologies and their social and environment implications and the consequences of ever- increasing scale of application of older technologies is one form of contribution of:


Select one:
A. Science to technology
B. Invention to innovation
C. Innovation to invention
D. Technology to science

Answers

Answer:

This report is a response to General Assembly resolution 72/242, in which the

Commission on Science and Technology for Development is requested, through the

Economic and Social Council, to give due consideration to the impact of key rapid

technological changes on the achievement of the Sustainable Development Goals. The report

contains analysis of the impact of rapid technological change on sustainable development,

especially the consequences for the 2030 Agenda for Sustainable Development’s central

principle of “leaving no one behind”. It presents the opportunities offered by rapid

technological change regarding the achievement and monitoring of the Sustainable

Development Goals across the various economic, social and environmental dimensions.

It discusses the transformative and disruptive potential of rapid technological changes,

including economic, social and normative considerations. In the report, it is highlighted that,

without appropriate science, technology and innovation policies, technologies, be they old

or new, are unlikely to deliver progress regarding global development. Such progress

requires an environment that nurtures learning and innovation to build and manage effective

innovation systems. In this context, the report presents examples of national strategies and

policies for rapid technological change and takes stock of regional, international and multistakeholder cooperation. In addition to national and international policies, the report also

calls for the international community to continue to discuss how international technology

assessment and foresight, as well as consensus building on normative guidelines, can shape

the developmental potential of rapid technological change. It concludes with suggestions for

Member States and the international community.

Explanation:

Type two statements. The first reads user input into person_name. The second reads user input into person_age. Use the int() function to convert person_age into an integer.

Answers

Answer:

brainliest

Explanation:

What is the correct clases for this drugs

‏Compazine
heelp me please

Answers

Answer:

making sense of medication classification

Explanation:

i think helping

Explain 5 different types of HTML tags and give examples.​

Answers

Answer:

Tag Description

<header> It defines a header for a section.

<main> It defines the main content of a document.

<mark> It specifies the marked or highlighted content.

<menuitem> It defines a command that the user can invoke from a popup menu

Designers are comparing performance between a multi-core processor equipped with 16 in-order cores and a dual-core superscalar processor. The dual-core superscalar processor has two identical Out- of-Order cores. Each core is a 4-issue superscalar. The multi-core processor has 16 in-order processor cores. Each in-order core of the multi-core processor can achieve about one third the performance of the OoO superscalar core. A benchmark program K includes both sequential codes that can only be executed on one CPU core and parallel codes that can be distributed to multiple CPU cores. For program K, execution of the sequential codes takes 30% of the total execution time.

Required:
Which processor would deliver faster performance for benchmark program K and show your calculations?

Answers

Explanation:

it will be k because it process faster an it comsume less elecricity

please helps me I'm really bad at this class!!!!!! 10 points

the drop down menus the same for both


web developer

web designer

design director

Answers

Answer:

Martha can apply as Web developer

Dave can apply as Design director

Why were Daguerreotype cameras not intended for the general public?

Answers

Answer:

The exposure time was vastly too long to be intended for practical use by photographers.

Explanation:

"The very first daguerreotype cameras could not be used for portraiture, as the exposure time required would have been too long. The cameras were fitted with Chevalier lenses which were 'slow' (about f/14). They projected a sharp and undistorted but dim image onto the plate."

PLEASE HELP ME!

Question 1. Mr. Beaver has four friends. They live in different houses. Each day he sets off from
home to visit one friend. When Mr. Beaver reaches a fork in the road he follows the arrow but, as
he passes, turns the arrow so that it now faces in the opposite direction. He always ignores the
arrows when retuming home.
On the first day he visits friend W. On day 2 he visits friend Y because he switched two arrows
around the day before. Etc.


2a) Which friend does Mr. Beaver visit on day 206? Explain your answer.
to come up with your answer

2b) Which aspect(s) of computational thinking were used

Answers

Answer:

2a) friend Y

2b) modulo calculations, state machines

Explanation:

After 4 days, history repeats itself. If you work out the first few days of the visiting pattern, you find that day 5 is identical to day 1.

So, if you divide the day number by 4 and take the remainder (i.e., the modulus), you get the original day number (where day 0 == day 4).

206 modulo 4 is 2, i.e., the second day where friend Y is visited.

The system behaves like a state machine with only 4 states.

List the resulting array after each iteration of the outer loop of the selection sort algorithm. Indicate the number of character-to-character comparisons made for each iteration (line 07 of the Selection Sort algorithm). Sort the following array of characters (sort into alphabetical order): C Q R B P D X.
public static void selectionSort (char[] a){
int n = a.length;
for (int i = 0; i < n; i++){
int min = i;
for (int j = i + 1; j < n; j++){
if (a[j] < a[min]){
min = j;
}
}
exchange(a, i, min);
}
}
private static void exchange(char[] a, int i, int j){
//exchange the value at index i with the value at index j
char temp = a[i];
a[i] = a[j];
a[j] = temp;
}

Answers

Answer:

$5+879+$431=$426809800

b. Explain five (5) procedures on how to copy slide master from one presentation to another in PowerPoint?​

Answers

Answer:

answer

Explanation:

Open both presentations: the one you want to copy a slide master from, and the one you want to paste the slide master into. In the presentation that has the slide master you want to copy, on the View tab, select Slide Master. In the slide thumbnail pane, right-click the slide master, and then select Copy.

True or False

1. Files are the container to store folders =

2. You can change name of file by using delete option

3.Recycle bin allows us to delete the flies permanently.

4. MSDOS is GUI based operating system


Answers

Answer:

1. False

2. False

3. True

4. False

Explanation:

1. Folders are the containers to store files

2. The delete option deletes the file

3. Files are moved to recycle bin after being deleted, and can be permanently deleted from recycle bin

4. "MS-DOS was the main operating system for IBM PC compatible personal computers during the 1980s, from which point it was gradually superseded by operating systems offering a graphical user interface (GUI), in various generations of the graphical Microsoft Windows operating system."

source for #4: Wikipedia

what's the function of a cyclebin​

Answers

Answer:

In Windows, the Recycle Bin is a folder or directory where deleted items are temporarily stored. Deleted files are not permanently removed from the hard drive but are sent instead to the Recycle Bin, unless they are too large.

1. What kind of metrics would be useful that are based on testing knowledge after security awareness training? The metrics could be obtained immediately after training or at periodic intervals over several months.

Answers

Answer:

i hope it will helpful for your

mark me brainlist

Explanation:

Metrics refer to a system or standards of measurement.

These are measures of quantitative assessment for the purpose of comparing, tracking and performance measurement.

When it comes to measuring employee's awareness, people's knowledge of comprehensive security awareness it can be monitored through online security awareness programs. The knowledge of the employees can be tested in regard of a hot topic i.e cybersecurity practices.

Online quizes can be used to show whether employees know the risks of leaving a computer unmonitored.

Simulated or planned cyber attacks, mockdrills can be planned by the company to test the presence of mind, readiness of employees after the training.

These things should be done without any prior notice so that the employees feel the real pressure and the situation is same as the real world

The metrics used to test the security awareness of the trained staff must be consistent, cheap to gather, can be expressed as cardinal or in percentage , and most importantly they should be contextually relevant i.e they should faciliate decision makers to take actions and attain the desired objective.

Awareness surveys are important baseline to test the knowledge of employees after the training. They are simple to set up and easy to use as well.

For example- all employees know that there is a security team but do they know their goals and policies of the team. Awareness surveys can be used to check these parameters and get the desired results from it.

Online security awareness programs may be used to track people's understanding of complete security awareness.

What are metrics?

The metrics used to assess the security awareness of the trained staff must be reliable, inexpensive to collect, expressed as a percentage or as a cardinal value, and most importantly, contextually relevant—that is, they must make it easier for decision-makers to take action and accomplish their goals.

As we know, online security awareness programs may be used to track people's understanding of complete security awareness when it comes to gauging employee awareness.

Employee expertise in relation to a current issue, such as cybersecurity procedures, can be evaluated.

Thus, online security awareness programs may be used to track people's understanding of complete security awareness.

Learn more about the matrices here:

https://brainly.com/question/15823780

#SPJ2

Which of the following tasks should be accomplished while preparing to write the body of an email?


Take a picture with of text messages with a camera and file it away


Back-up text messages from your phone to an email account


Send a copy of the text message to another phone


Write a copy of all the text messages you would like to save

Answers

Answer:

Write a copy of all the text messages you would like to save

The task that should be accomplished while preparing to write the body of an email is:

D. Write a copy of all the text messages you would like to save.

Activities involved while preparing to write body of an email

Preparing to write the body of an email involves organizing and gathering the necessary information to include in the email.

In this context, writing a copy of all the text messages that you would like to save is the most relevant task to accomplish before composing the email. This task ensures that you have the content you want to reference or include in the email readily available and helps you structure the email effectively.

The other tasks listed are not directly related to the email writing process and can be done separately at other times for different purposes.

Learn more about writing email at

https://brainly.com/question/24688558

#SPJ2

Mei is working from home and speaking with her department manager on a Voice over IP (VoIP) phone connection. This technology allows telephone conversations to be routed over the Internet. During a VoIP conversation, Mei loses a few moments of what the manager has said to her. What is the problem

Answers

Session Layer consists that controls dialogues (interconnection) among machines in the ISO open platforms (OSI) model.

It sets up, manages, and stops the local and distant application interactions. It generates communication channels between devices, called sessions.Therefore, every OSI model Session Layer having dropped momentarily its line of communication because the information is deleted due to the magnets which drop the sessions.

Learn more:

brainly.com/question/14255125

Three enhancements with the following speedups are proposed for a new machine: Speedup (a) = 30, Speedup (b) = 20, and Speedup (c) = 15.

Answers

Answer:

mark me brainlist please

Explanation:

Three enhancements with the following speedups are proposed for a new machine: Speedup (a) = 30, Speedup (b) = 20, and Speedup (c) = 15. C should be have highest enhancement.

What is speedups?

Speedup is a metric used in computer architecture to compare how two systems perform when solving the same task.

Technically speaking, Speedup is the increase in task execution speed when performed on two comparable architectures with various resources.

Further Amdahl's law, which was primarily focused on parallel processing, developed the idea of speedup. However, speedup can be applied more broadly to demonstrate how resource improvements affect performance.

[tex]{\displaystyle L = frac 1 v = frac T W, where L = frac 1 v = frac T W.[/tex]

Where v is the task's execution speed, T is the task's execution time, and W is the task's execution workload.

Further The rate at which a task is executed is the throughput of an architecture:

[tex]displaystyle Q=rho vA=frac rho AWT=frac rho AL, Q=rho vA=frac rho AWT=frac rho AL[/tex]

Throughput and latency are two different types of quantities for which speedup can be defined. The relationship between latency and task execution speed is reciprocal.

Learn more about speedups:

https://brainly.com/question/29848325

#SPJ2

which of the following is an input device
1.speaker
2.projector
3.touch screen
4.non of the above

Answers

Answer:

non of the above

Explanation:

i am not sure but i hope it will help

Answer:

none of the above is the answer

which is true about artificial intelligence? a) can think b) act as body c) act as brain d) can learn.

Answers

Answer:

c). act as brain.

Explanation:

brain thinks and learns, so it covers a and d

[tex].[/tex]

C- act as brain
Reason: because a A.I. Can’t really learn if it’s programmed for a specific function and can’t act as a body if there programmed to do something they don’t really think in the process if it’s all 1’s and 0’s they just do what there told unless there programmed to do otherwise and programmed to learn and think individually


Data stored in an online server can be described as being:

O in ROM
in the cloud.
O in RAM
O a flash drive.

Answers

Answer:

B

Explanation:

Data that is stored in an online server can be described as being in the cloud. This may also be a reason why you might have heard about "cloud computing" or saving files "in the cloud."

---

Other Choices:

A - Read-only Memory (ROM) is a type of non-volatile memory (memory stays even after power is removed) and is useful in storing rarely-used software on the computer.

C - Random Access Memory (RAM) is a type of volatile memory that is used to retain active data and machine code.

D - A flash drive is a type of device that can electrically store, erase, and reprogram data by using flash memory. A USB drive (or "stick") is a common medium.

What is the most helpful way to adopt the practice of design thinking, regardless of which framework is your favorite?

Answers

Answer:

Defining, framing and solving problems from users' perspectives

Explanation:

Stretching, walking, and meditation because stretching allows everything to be loosened or not as firm walking is part of everyday life and meditation is sitting in a calm comfortable position typically with calm music as well to clear your mind.

Why these are considered as very complex?

These are all very complex because they require strength in your body and some people can't do these. Some have bad kneens so lunges can seriously hurt them others have weak arms so they can't push or hold their body wait for long periods of time and squats are difficult to do in the correct position because we can't typically do that without an actual chair

My most favorite are jumping jacks and meditation. Jumping jacks because it gets your adrenaline pumping and meditation because you can only hold so much in your mind before you get tired out. My least favorite are squats and planks. Squats are very difficult to do because you are litteraly sitting down with your back straight and the same dip of a chair but without it actually there do it's very complex.

Therefore, Stretching, walking, and meditation because stretching allows everything to be loosened or not as firm walking is part of everyday life and meditation

Learn more about Stretching on:

https://brainly.com/question/1171877

#SPJ2

Programming challenge description: In this challenge, you're given a string containing jumbled letters from several concatenated words. Each word is a numeral from zero to nine. Each numeral may be used multiple times in the jumbled string. Write a program that returns integers corresponding to the numerals used to form the jumbled string. Integers must be sorted in ascending order. For example, reuonnoinfe are shuffled letters of the strings one four nine. Your program's output should be 149. Input: A string formed from jumbled letters of numerals. For example:

Answers

Following are the Java program to the given question:

import java.util.*;//import package

public class Jumbledletters //defining Jumbledletters class  

{

public static void main (String[] axv)//defining main method

{

String num[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};//defining an arrayof string

int i,j;

Scanner xc = new Scanner(System.in);//creating Scanner class object to input value

System.out.print("Enter value: ");//print message

String v= xc.next();//defining a String variable that input String value

for(i=0; i<num.length; i++)//defining a loop to count input String length

{

String s = num[i];//defining a string variable to hold array value

boolean f = true;//defining a boolean variable

for(j=0; j<s.length(); j++)//defining a for loop that convets value into integer

{

char c = s.charAt(j);//defining char variable that hold value

if(v.indexOf(c)==-1)//defining if block to check indexOf value

{

f = false;//use boolean variable that hold boolean value

break;//using break keyword

}

}

if(f) //use if to check boolean value

System.out.print (i);//use print method that print i value

}

System.out.println();//use print method for beak line

}

}

Output:  

Enter value: onefournine

149

Explanation of code:

Import package.Defining the Jumbledletters class and also define the main method in it.Inside the main method defining a string of array "num" that holds string value and two integer variables "i,j" is defined.In the next step, a scanner class object is declared that inputs the value.After input, a value a for loop is defined that uses a string variable that holds an array value and uses another loop that converts string value into a numeric value.

Learn more:

brainly.com/question/24379089

What two terms are used for the methods that are used to observe or modify the state of an object, respectively

Answers

The answer is: accessors and mutators

Accessors and Mutators are used to observe or modify the state of an object respectively.

The two terms used for the method that is used to observe or modify the state of an object, are accessors, and mutators.

What are accessors, and mutators?

Arrangements and mutators are both used in Java to find and set the value of private fields, respectively. Accessors and algoritmo are both referred to as getters and setters, respectively.

The verb "access," which enables the user to access the secret data in a class, serves as the inspiration for the name of the accessor function.

Accessors are the same as "winners," the "get" operation, and other similar terms. The private constants and variables are retrieved by the getters so that they can be used outside of a class.

To learn more about accessors and mutators,

https://brainly.com/question/13098886

#SPJ12

Other Questions
a shopkeeper sold 16 articles for a total of 400 and made a profit of 48.00 how much did each article cost him Please help due today I need help on this question. Based on Ponyboys description of his parents, what similarities do you see between the brother and the mother and the father? What differences do you see? Explain the importance of profession How did Empress Dowager Cixi challenge traditional norms and values? Which verb does NOT follow a similar conjugation pattern as other verbs? A) regarder B) finif C) vendre D) aller what difference between mks system ana cgs sustem in box In which areas are Spanish mostly spoken and used as official language? PLEASSEEE HELPPPPPPPPP I WILL GIVE BRAINLIEST 5-7 sentences that describe the life cycle of a star Which statement is true about the relationship building strategy of "showing care and respect"? A. If the client cannot understand what you are saying, this strategy is not important. B. It is important to pay attention to changes in the client's behavior that might indicate illness and to make changes accordingly. C. Use language that the client doesn't understand. D. Always discuss challenging situations with the client in the room. A spelunkers starts his journey at -500 feet and ends up at -100 feet.What is his change in elevation? Question 2Which results in a net value of 0?O John has $25 and spends $10O John gives away 4 out of 5 of his canned sodasO John buys a shirt for $20 and returns it for a refund of $20O John makes $8 but owes Tracie $5 what is a dictatorship in your own words? What is p (salamander)? let f(x)=2x-1 and g(x)=1/x. Find the value of f(g(7)) What is 127 divided by 4 La Primera Junta de Gobierno legitim su existencia en el principio jurdico de....................................en ausencia del......................................... En el Ro de la Plata, la interpretacin de ese principio gener un debate entre la posicin...........................................y la posicin............................... La primera reconoca la preponderancia de...............................y la segunda, colocaba e pie de igualdad a todas las........................... en tanto sujetos de iguales derechos soberanos. hola me ayudan porfa.. I'LL GIVE BRAINLIEST;You deposit $400 each month into an account earning 5% annual interest compounded monthly.a) How much will you have in the account in 20 years?b) How much total money will you put into the account?c) How much total interest will you earn?