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] .
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
|