Analyze the worst-case runtime of the new merge sort

Assignment Help Data Structure & Algorithms
Reference no: EM131126233

Assignment : Recursions and Complexity

1. Double Tower of Hanoi contains 2n disks of n different sizes, with two disks of each size. You must move all 2n disks from one peg to another, but you may move only one disk at a time, without putting a larger disk over a smaller one. How many moves does it take to transfer a double tower from one peg to another if disks of equal size are indistinguishable from one another? Find a recurrence relation for the number of moves. Then, solve the recurrence relation.

2. Below is pseudocode for a modified merge sort algorithm. This new algorithm partitions the list into four sublists instead of the usual two:
procedure newmergesort.a[1, ..., n].
input:

output:

if n > 1 then

L1 = merge (newmergesort(a[ 1, ..., |n/4J ), newmergesort.(a[ |n/4J + 1, ..., |n/2J ]
L2 = merge (newmergesort(a[ |n/2J + 1, ..., |3n/4 ], newmergesort a[ |3n/4J + 1, ..., n ])

merge(L1, L2)

Complete the following two problems to determine if it is possible to improve the complexity of merge sort by partitioning the list into more than two lists of smaller sizes.

a) Analyze the worst-case runtime of the new merge sort (you may make reasonable as- sumptions about the length of the list).

b) Compare the complexity of the original merge sort with the complexity of the new merge sort.

3. Solve the following recurrences:

a) T (n) = 7T (n - 1) - 10T (n - 2) for n ≥ 2, T (0) = 2 and T (1) = 1.

b) T (n) = 6T (n - 1) - 8T (n - 2) for n ≥ 2, T (0) = 4 and T (1) = 10.

c) T (n) = T (n - 2) for n ≥ 2, T (0) = 5 and T (1) = -1.

d) T (n) = -4T (n - 1) + 5T (n - 2) for n ≥ 2, T (0) = 2 and T (1) = 8.

Reference no: EM131126233

Questions Cloud

Describe how the following business transactions : Describe how the following business transactions affect the three elements of the accounting equation.a. Invested cash in business.b. Received cash for services performed.c. Paid for utilities used in the business.d. Purchased supplies for cash.e. Pu..
Rhetoric and science final paper assignment : Your final paper will be a 5-8 page analysis of one document from one of the case studies we have covered this semester.  The paper is due by the end of the day on Saturday, July 16.
How plea bargaining affects the criminal justice process : As you learned in your readings this week, a vast majority of criminal cases are resolved through plea bargaining. Evaluate when plea bargaining can occur, the ethics of plea bargaining, and how plea bargaining affects the criminal justice process..
Analyze the worst-case runtime of the new merge sort : Analyze the worst-case runtime of the new merge sort and compare the complexity of the original merge sort with the complexity of the new merge sort.
How constitutional right is practically applied to protect : Explain how the constitutional right is practically applied to protect the individual and/or society as a whole. Provide your personal opinion on the relative strength and/or weakness of this constitutional issue moving forward in the 21st century..
Mba level human resource management online : The responses should include answering the main discussion questions, fully, including proper cites as well.  If you use citaitons I should be able to look it up to use for reference to understand.  The professor requires that the questions be res..
In what phase of the cell cycle is dna replicated : In what phase of the cell cycle is DNA replicated? Tendons and Ligaments heal with scar tissue and do not repair completely due to
Coordinator in the human resources department : Create a training plan for this Customer Service program and include it in your report. Download this Training Plan Template and use it to provide a framework for the development of your Training Plan.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Survey of fault tolerance policy for load balancing scheme o

This paper investigates about fault-tolerance in load balancing schemes in distributed environment. There are some more parameters influencing QOS but our main focus is on fault tolerance and load balancing.

  Question about software importance

Determine what makes software so important and list a number of ways that software has an impact on our life.

  How to implement a class called hugeinteger

Using your own Linked List implementation (see attached), implement a class called HugeInteger that represents arbitrary sized integers and supports addition only. You may only use the tools we have introduced in class, and you MAY NOT use Java's ..

  Which of the following tabs is not found in format cells

If the value for Revenue is stored in C5 on Sheet1 and the value for Expenses is stored in C6 on Sheet2, the formula, revenue -expense would read

  Submit your programs by email the program should have as

submit your programs by email. the program should have as many comments as necessary. the top comments should explain

  Algorithm to concatenate string in single binary search tree

Create algorithm which concatenates T1 and T2 into single binary search tree. Worst case running time must be O(h).

  Draw a structured flowchart or write pseudocode

Draw a structured flowchart or write pseudocode that describes the process of looking up a word in a dictionary. Pick a word at random and have a fellow student attempt to carry out your instructions

  Similar to last lab this lab is comprised of a series of

similar to last lab this lab is comprised of a series of mini tasks. in order to get credit for this lab you must

  Estimate cost of multi phase multiway merge sort

Find out number of phases needed, and estimate cost of Multi Phase Multiway Merge Sort. Write all BCNF violations. Decompose relations, as essential, into collections of relations whic hare in BCNF.

  Write algorithm to find schedule obtains maximum amount

Write down algorithm to find schedule which obtains maximum amount of profit, assuming that all processing times are integers between 1 and n. Determine running time of your algorithm.

  Show how the box can be used to factor n

That is, given a quadratic residue y, the box outputs an x with x2 = y (equation is modulo n). Show how the box can be used to factor n.

  Write the relation r as a set if ordered pairs

let A={a,b,c,d,e} and suppose R is an equivalence relation on A . Suppose R has two equivalence classes. also aRd ,bRc and eRd in R . WRITE the relation R as a set if ordered pairs

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd