Induction proof and recursion

Assignment Help Mathematics
Reference no: EM131167206

Exercise 1 Induction Proof and Recursion

1. Let N = {0, 1, 2, . .} be the set of natural numbers. Access to data structures is often governed by the recurrence

T(n) = a,     if n = 1

           c + T(n/2),  if n>1

Prove by induction that T (n)  ∈ O (log n). Do not attempt to use the Master Theorem for this proof.

2. Remind how merge-sort works. Show that recursive merge-sort is Θ(n log n) by the master theorem.

Exercise 2 Algorithm design

Describe a Θ(n log n)-time algorithm that, given a set S of n integers and another integer x, determines whether or not there exist two elements in S whose sum is exactly x.

Exercise 3 Binary heaps

1. Assume you have an array-based binary heap a with the contents:
1, 4, 7, 8, 9, 10, 14, 12, 15, 13, 17, 12

Show the contents of a after each of the following two operations. Show your working for each operation including the content of the list at its intermediate stages.

You can assume a is large enough to contain all the values inserted.

- Insert 5 into a,
- Delete the least element from a,

2. Is it right or wrong that in a heap of depth d, there must be at least 2d elements. (Assume the depth of the first element (or root) is zero). If it is right, provide your prove. If it is wrong, explain why you think so.

3. Prove that the binary tree represented by the binary heap of n elements has height k = [log n] .

Reference no: EM131167206

Questions Cloud

Explain each step of the machine cycle : Explain (in detail) each step of the machine cycle. Show the contents of each of the registers and each of the memory cells after the execution of the code.
Maximize the efficiency of external storage : How are B-trees used to maximize the efficiency of External Storage? Discussion of efficiencies should include "Big O" notation, such as O(1), O(log N), O(N), O(N^2), answer must be at least 10 sentences.
How low should lowland let its tv inventory drop : The weekly demand for TVs at Lowland Appliance is normally distributed with mean 400 and standard deviation 100. - How low should Lowland let its TV inventory drop before it places an order for more TVs?
How would you like to work on this assignment for me : How would you like to work on this assignment for me? Select a NOSQL database (MongoDB, Cassandra, DynamoDB, BigTable, etc...) and write a paper describing its security features. In particular, you should discuss:
Induction proof and recursion : Describe a Θ(n log n)-time algorithm that, given a set S of n integers and another integer x, determines whether or not there exist two elements in S whose sum is exactly x.
Find a route with the least total airfare : Find a route with the least total airfare that visits each of the cities in this graph, where the weight on an edge is the least price available for a flight between the two cities.
What standard deviation minimize annual cost : What standard deviation minimizes the annual cost of producing elevator rails?- one elevator rail in 1000 will be at least how many inches in diameter?
Rap about classes that rivals the javadev group : The JavaDev group made the "Java Life" rap video on coding in Java. You can watch themhere. Your challenge is to write a rap about classes that rivals the JavaDev group. Write just a few sentences
How many people will choose to sell cat berets : Suppose there are many sellers with the same costs as Foster. If there are 24 people on Etsy willing to buy 1 cat beret each for $34, how many people will choose to sell cat berets

Reviews

Write a Review

Mathematics Questions & Answers

  How many hits can the player expect to have

Last season a major league baseball player got 120 hits in 240 times at bat. If the player expects to bat 500 times in the entire season with the same ratio of hits to at bats, how many hits can the player expect to have?

  Depict a matlab program to value a swing swap

Write a Matlab program to value a swing swap, Program a Monte Carlo model for options on Energy. It should be mean-reverting and include spikes. Give several alternative structures

  Determine the probability that no cars arrive ever

suppose that cars arrive at a traffic light according to a Poisson process with a rate of one car per minute starting from t=0 minutes.

  Calculation of dual problem using simplex method

You are given the final simplex tableau for the dual problem. Give the solution to the primal problem and the associated dual problem.

  What is the are of the field

a field is in the shape of a trapezoid. the altitude of the trapezoid is 120 feet and the bases of the trapezoid are 180 feet and 200 feet. what is the are of the field?

  Compute the pearson correlation

What are the Sum of Squares between (SSB) and what is the degress of freedom within (dfW)

  Explain important information about find the probabilities

Important information about Find the probabilities, Suppose a family plans 6 children, and the probability that a particular child is a girl is ½.

  Near equation that models the temperature as a function

near equation that models the temperature as a function of the number of chirps per minute .

  How much would the systolic blood pressure have to increase

How much would the systolic blood pressure have to increase in order to restore the flow in the 50% occluded artery so that it matches the flow in an open artery with a systolic pressure of 120 mm Hg?

  What is the intersection of the given sets

In calculus and other branches of analysis, the notation (a, 8) represents the set {x Î R | a }. Consider all sets of the form (a, 8) where a ΠR. What is the intersection of all of these sets?

  Explain the five-steps for solving rational equations

Explain the five-steps for solving rational equations. Can any of these steps be eliminated? Can the order of these steps be changed? Would you add any steps to make it easier, or to make it easier to understand?

  A linear optimization model based problems

Identify the decision variables, objective function, and constraints in simple verbal statements.

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