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
Anestetic [448]
3 years ago
9

Rewrite the MERGE procedure so that it does not use sentinels, instead stopping once either array L or R has had all its element

s copied back to A and then copying the remainder of the other array back into A.
Computers and Technology
1 answer:
Strike441 [17]3 years ago
4 0

Answer:

Merge sort is a sorting technique based on divide and conquer technique.

Explanation:

MERGE(A, p, q, r)

   n1 = q - p + 1

   n2 = r - q

    L[1..n1] and R[1..n2]   this creates the new array

   for i = 1 to n1

       L[i] = A[p + i - 1]

   for j = 1 to n2

       R[j] = A[q + j]

   i = 1

   j = 1

   for k = p to r

       if i > n1

           A[k] = R[j]

           j = j + 1

       else if j > n2

           A[k] = L[i]

           i = i + 1

       else if L[i] ≤ R[j]

           A[k] = L[i]

           i = i + 1

       else

           A[k] = R[j]

           j = j + 1

You might be interested in
What ideas should I write about for information writing
Lady bird [3.3K]
Well first of all who is your favorite celebrity?
Then find some research and look up interesting facts you did not know about.
5 0
3 years ago
Read 2 more answers
Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county s
iVinArrow [24]

Answer:

purchase_amount = float(input("Enter the amount of a purchase: "))

state_sales_tax = purchase_amount * 0.05

country_sales_tax = purchase_amount * 0.025

print("The amount of the purchase is " + str(purchase_amount))

print("The state sales tax is " + str(state_sales_tax))

print("The county sales tax is " + str(country_sales_tax))

print("The total sales tax is " + str(state_sales_tax + country_sales_tax))

print("The total of the sale is " + str(purchase_amount + state_sales_tax + country_sales_tax))

Explanation:

*The code is in Python.

Ask the user to enter purchase amount

Calculate the state sales tax, multiply purchase amount by 0.05

Calculate the county sales tax, multiply purchase amount by 0.025

Calculate the total sales tax, sum the state sales tax and county sales tax

Print the amount of the purchase, state sales tax, county sales tax, total sales tax and  total of the sale

7 0
3 years ago
A _____ is a character or group of characters that has a specific meaning. a. field b. record c. file d. database
zubka84 [21]

A character or collection of characters with a specific meaning is called a field.

<h3>What does the technical term "field" mean?</h3>

A field is a purpose-driven, typically fixed-sized section in a fixed or known location within a unit of data, such as a record, message header, or computer instruction. A field may be divided into smaller fields depending on the situation.

<h3>What does a file structure field mean?</h3>

A record is an entire set of fields, a field is a single piece of information, and a file is a collection of records. An analogy between a file and a phone book is a phone book. There is a list of records in it, and each record has three fields: a name, an address, and a phone number.

learn more about field here  

<u>brainly.com/question/28002617</u>

#SPJ4

8 0
1 year ago
When comparison shopping, all of these hint at a good deal EXCEPT_____________________.
pav-90 [236]

Answer:

lower-priced models offer more features

Explanation:

4 0
3 years ago
PLS HELP
kvasek [131]

Answer:

informative, discrimiitive,critical thats the order

4 0
3 years ago
Other questions:
  • Why would an over the shoulder shot be used
    11·1 answer
  • What command would you use to list the text files in your
    7·1 answer
  • You’re creating a table for one of your slides, and need to make some modifications to your table structure. Which of the follow
    6·2 answers
  • Write a program that asks the user for two file names. The first file will be opened for input and the second file will be opene
    8·1 answer
  • The ? contains software routines that developers use to create a consistent computer environment
    6·2 answers
  • TRUE AND FALSE
    10·1 answer
  • Write an expression that prints 'You must be rich!' if the variables young and famous are both True.
    6·1 answer
  • 2. Which property is used for hiding text of the textbox?
    14·1 answer
  • X = 9 % 2if (x == 1):  print ("ONE")else:  print ("TWO")
    13·1 answer
  • Given two objects represented by the tuples (22, 1, 42, 10) and (20, 0, 36, 8):
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!