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
Explain Cascading Style Sheets and what they do. Describe their primary function, two effects that this function has on programm
Leni [432]

Answer:

Cascading Style Sheets are special codes that is used to style or format a web page.

Explanation:

<em>Imagine, you have two web pages, and you have to style them both, using a single format. For example, in two linked web pages, you wanted both information, can be read in uniform colors, style and font size. It would be much easier if you apply only one formatting tag to them right? But that is not the case in HTML (Hypertext Mark Up Language). You have to create formatting tags that is mixed with them to be able to style or format the page or text. CSS can make this easier. All you have to do is use a single format the call on the style by means of tag. The purpose of this is to create uniformity to all web pages and to minimize the coder's efforts. It can also be used in formatting tables (like cellpaddings, border styles, border thickness, color and other things that requires formatting in HTML. Listed below is a sample CSS codes for two different web pages. </em>

<em> </em>

<em>This file is saved as try.html </em>

<em><html> </em>

<em><head>  </em>

<em><link rel="stylesheet" type="text/css" href="style.css"> </em>

<em></head> </em>

<em><body> </em>

<em><p> The quick brown fox </p> </em>

<em></body> </em>

<em></html> </em>

<em> </em>

<em>And another file is saved as trytwo.html </em>

<em><html> </em>

<em><head>  </em>

<em><link rel="stylesheet "type="text/css" href="style.css"> </em>

<em></head> </em>

<em><body> </em>

<em><p> Jumps over the lazy dog </p> </em>

<em></body> </em>

<em></html> </em>

<em> </em>

<em>style.css </em>

<em> body{ </em>

<em>background-color: lightblue;  } </em>

<em> </em>

<em>p{ </em>

<em>color: navy; } </em>

<em> </em>

<em> Both webpage will be using the same font color which is navy blue. This would prevent the coder or programmer to redo the font formatting tags.With a single file, he can re use the styles to other webpages. </em>

<em> It would benefit the programmer to save himself effort and time. And it would allow him to debug the codes in much easier way. </em>

<em />

4 0
3 years ago
True or false that computers that are joined together are able to share hardware and software, but not data
kozerog [31]
False computers are able to share hardware and software but not data
8 0
3 years ago
Algorithm to calculate the area of a square.​
podryga [215]

Answer:

length = int(input("Enter a length "))

width = int(input("Enter a width "))

area = length * width

print("The area is " + area)

6 0
2 years ago
1. Se requiere implementar un conversor unipolar que tendrá una tensión analógica variable entre 0 y 2 V pico. Deberá tener una
PolarNik [594]

Answer:

A

Explanation:

Because

7 0
3 years ago
Travelers should keep their profile information up-to-date. which is not an option for a traveler to update their own profile in
Komok [63]

After logging onto DTS, on the Welcome screen, hover over Traveler Setup and select Update Personal Profile.

<h3>What is Setup?</h3>

Setup is the arrangement of something, or a competition when the winner is already known because the two competitors are not evenly matched. The setup of food and beverages at a party is an illustration of a setup. A setup might involve pairing a strong debater with a weak debater.

Whether we like it or not, US English spellings have a significant influence on a lot of our language today. Therefore, the phrase "setup" is used when discussing the start of computer programs, but in all other contexts, the words "to set up" and "the set-up" are used instead.

Informal. an endeavor or competition that is made purposefully simple. a game or contest where the opponent can be easily defeated without risk or effort.

To learn more about Setup from the given link:

brainly.com/question/25736513

#SPJ4

4 0
2 years ago
Other questions:
  • To extend the bottom border of a hyperlink across the complete width of a navigation list, change the ____ property of each hype
    9·1 answer
  • when reading a recipe ingredients witch substance make the rice an unhealthy choice if it is present in a high amount
    13·1 answer
  • Ray has to type an invoice using the QWERTY keyboard. Along with letters and numbers, he also has to insert the dollar sign. Whi
    13·1 answer
  • A certain database has numerous tables, but they do not share any fields in common. this database will not be as powerful as oth
    15·2 answers
  • To create a new query in Design view, click CREATE on the ribbon to display the CREATE tab and then click the ____ button to cre
    9·1 answer
  • List 3 items that were on kens resume that should have been excluded
    13·2 answers
  • Moving laterally within a network once an initial exploit is used to gain persistent access for the purpose of establishing furt
    10·1 answer
  • Write a method printshampoolnstructions0, with int parameter numCycles, and void return type. If numCycles is less than 1, print
    8·1 answer
  • What feature is available to add a auggestion in the margin of someone else's document.
    11·1 answer
  • The Power of If Worksheet
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!