subject

Normally in merge sort we take an array, split it into two arrays of half the length of the original, sort those recursively, then merge the results together. In this problem you're asked to modify the merge sort to make 3 equally sized recursive calls:.
create 3 arrays of 1/3 the original length,
make recursive calls on all 3, and
merge the 3 (now sorted) arrays together.
Note, the size of A will always be divisible by 3 evenly (i. e. A. length%3==0).
Hint: for an array C and an index i, ((i>=C. length)?C[i]:Integer. MAX_VALUE) will be the value at C[i] if i is inbounds and "infinity" otherwise.
Example:
Given {5,8,3,1,7,2,9,6,4}
the 3 recursive calls would be made on {5,8,3}, {1,7,2}, and {9,6,4}
3 subsequent recursive calls (3 sets of 3) would be made on ({5}, {3}, & {8}), ({1}, {7}, & {2}), and ({9}, {6}, &{4})
3 merges are done to create {3,5,8}, {1,2,7}, and {4,6,9}
these results are then merged back into the original array as {1,2,3,4,5,6,7,8,9}.
Example:
Given {4,7,2}
the 3 recursive calls could be {4},{7},{2}
the resulting merge is {2,4,7}
The signature of your method will be
public static void merge3 Sort(int[] A)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Which action is good business etiquette? a. switching your cell phone off before you enter a meeting b. keeping your cell phone on low volume before you enter a meeting c. setting a pleasant ring tone on your cell phone before you enter a meeting d. setting a standard ringtone on your cell phone before you enter a meeting
Answers: 1
question
Computers and Technology, 25.06.2019 04:20
Austin rare coins, inc., buys and sells rare coins, bullion, and other precious metals through eight web sites with different domain names. an unknown individual took control of austin's servers and transferred the domain names to another registrant without austin's permission. the new registrant began using the domain names to host malicious content—including hate letters to customers and fraudulent contact information—and to post customers' credit-card numbers and other private information, thereby tarnishing austin's goodwill. austin filed a suit in a federal district court against the new registrant under the anticybersquatting consumer protection act. is austin entitled to a transfer of the domain names? austin rare coins, inc., buys and sells rare coins, bullion, and other precious metals through eight web sites with different domain names
Answers: 3
question
Computers and Technology, 25.06.2019 08:30
While using pert (program evaluation review technique) and cpm (critical path method) techniques, activities that are not on the critical path are more inflexible than those activities on the critical path. select one: true false
Answers: 1
question
Computers and Technology, 25.06.2019 10:10
Suppose you and your friend live on the same street d miles away from each other. between your house and your friend’s house there are n motorized scooters positioned at distances x1, x2, . . , xn miles from your house towards your friend’s house. each scooter has a battery that may or may not be fully charged. let’s say that the scooters can take you distances d1, d2, . . , dn miles down the road. each scooter also has a price p1, p2, . . , pn that it takes to activate. any time you encounter another scooter, you may take the new scooter and leave your old scooter behind. there is an additional scooter at your house that you start with and it can go distance d0 miles and it is free to activate: p0 = 0. you wish to go to your friend’s house minimizing the total amount of money spent activating the scooters. design a dynamic programming algorithm that returns the minimum cost to get to your friend’s house using scooters x0, . . , xn.
Answers: 1
You know the right answer?
Normally in merge sort we take an array, split it into two arrays of half the length of the original...
Questions
question
Mathematics, 25.01.2020 13:31
Questions on the website: 13722361