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
Digiron [165]
3 years ago
13

Mergesort uses the divide-and-conquer technique to sort a list. True False

Computers and Technology
1 answer:
NARA [144]3 years ago
6 0

Answer:

True: Merge Sort sorts a list using divide-conquer approach.

<u>Merge_Sort(B,p,n)</u>  //p is the starting index of array B and n is the last index.

1. if(p<n)

2.        q ← (p+n)/2    //divides the list into two sub-lists

2.        Merge_Sort(B, p, q) //sorts the left half

3.        Merge_Sort(B, q+1, n) //sorts the right half.

4.        Merge(B, p, q, n)

<u>Merge(B, p, q, n)</u>

1.l ← q-p+1.  //no. of elements in left half

2.m ← n-q  //no. of elements in right half.

3.for x ← 1 to l

4.      Left[x] = B[p+x -1] //The elements of left half are copied to Left array

5.for y ← 1 to m.

6.      Right[y]= B[q+y]  //The elements of right half are copied to right array

7. x ← 1, y ←1

8.for z ← p to n.

9.      if( Left[x] ≤ Right[y] ) // to merge the two lists Left and Right, the    //elements are compared.

10.     {   A[z] ← Left[x]   //smaller one comes to the merged list.

11.          x++. }

12.    else

13.      {   A[z] ← Right[y]

14.          y++ }

Explanation:

The Merge_Sort(A, p, n) algorithm first divides the whole array into two halves. Then again divides the sub-lists into it's halves and so on.

Then using merge algorithm it compares the elements of both halves one by one and keep it in sorted order.

You might be interested in
Which image file format is the most widely used?
Ostrovityanka [42]

Answer: jpeg because its a lot of people use it for quaity

7 0
1 year ago
What is the error in the following pseudocode?
kykrilka [37]
I do not know the answers sorryy
4 0
2 years ago
What are benefits of using scenarios? check all that apply
barxatty [35]

Answer:

The benefit will be to "Reduce income volatility". The further explanation is given below.

Explanation:

  • The scenario could become theoretical, linear, or non-linear historical or conceptual.
  • Eventually, through the utilization of scenario analysis which helps shareholders avoiding looking for someone to blame and find investment opportunities which might improve equity returns and rising income fluctuations.

So that the above will be the right answer.

8 0
3 years ago
You were recently hired by a small start-up company. The company is in a small office and has several remote employees.
Romashka [77]

Answer:

D) IaaS

Explanation:

In this scenario, the best cloud service model would be IaaS. This stands for Infrastructure as a service (IaaS) and basically provides all the physical infrastructure that a company needs virtually. The company itself purchases a piece of software that allows them to remotely use all of the infrastructure provided by the service. Meaning they have access to computing power, data centers space, servers, networking, etc. without actually purchasing any of the physical hardware. This would solve all of "your" business needs as asked by the company.

6 0
3 years ago
PLEASE ASAP!!
galina1969 [7]
The correct answer should be true, as their job is to *edit* the footage.
7 0
2 years ago
Read 2 more answers
Other questions:
  • Safety interlock module operates by monitoring the voltage from the
    7·1 answer
  • Which of these monitor connector types is the oldest and least desirable to use?
    12·2 answers
  • What type of form control is typically used for displaying text or numbers?
    8·2 answers
  • A mother calls you to report that her 15-year-old daughter has run away from home. She has access to her daughter's e-mail accou
    6·2 answers
  • What type of cable would you use to connect two hosts together in a back-to-back configuration using twisted pair cable?
    15·1 answer
  • What is the name of the advanced warrior race of robots in Doctor Who?
    10·2 answers
  • A static class method can be accessed without referring to any objects of the class. True False
    7·1 answer
  • AP CSA help needed. Java please.
    11·1 answer
  • What country is associated with the tor relay using the ip address 104. 244. 74. 97?.
    6·1 answer
  • What is a system of access control that allows only limited use of material that has been legally purchased?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!