Reference no: EM131168812
Design and Analysis of Algorithms
Questions: Search:
1. Suppose you are given a set P of integers and another integer x. We wish to use a Θ(n2) algorithm to decide whether there are 3 integers in P and the sum of these three integers equals to x. Show your algorithm and indicate why its complexity is Θ(n2). (You can use pseudo code or by illustration only)
Recurrence:
2. Using a recursion tree, show the process how to solve the following recurrence in terms of the big O representation. Use the substitution method to verify your result.
T(n) = 4T(n/4)+cn
Sorting:
3. Can RADIX SORT shown in our textbook work correctly if we use QUICKSORT instead of COUNTING SORT to sort each individual digit? Justify your answer.
Data structures:
4. If we perform an inorder traversal on a Min Heap (as defined in the textbook), will we get the values in sorted order? Why or why not? Use a simple example to justify your answer.
Greedy algorithms and dynamic programming:
5. You have n programs p1, ..., pn with size m1, ..., mn MB (mega bytes). You have a disk that can store up to W MB. W is less than the total size of the programs. You are asked to use a dynamic programming solution to store the programs onto the disk so as to maximize the disk space utilization. In other words, you want to find a subset of programs such that its total size is maximized but has to be less than C.
Define U[i,w] as the maximum disk utilization of a disk with capacity w MB and programs p1,...,pi to be selected for storing it on the disk. Write a recurrence for U[i,w] and identify the boundary condition.
6. Consider the problem of making change for n cents using the fewest number of coins. Assume that each coin's value is an integer.
1) Describe a greedy algorithm to make change consisting of quarters, dimes, nickels, and pennies. Prove that your algorithm yields an optimal solution.
2) Give a set of coin value combination (the value of coins may not be limited to quarter, dime, nickel, or penny) for which the greedy algorithm does not yield an optimal solution. Your set should include a penny value so that there is a solution for every possible value of n. Use an example to justify your answer.
Tree and graph:
7. Given the following weighted undirected graph, show the order the edges would be added for building a spanning tree using Kruskal's and Prim's algorithm. Take the following figure as an example, order edges added using two algorithms. In addition, how many edges will be picked up to build the tree? Why? Show your process.

8. For each of the following, either draw a graph satisfying the given criteria or explain why it cannot be done. Your graphs should be simple, i.e. not having any multiple edges (more than one edge between the same pair of vertices) or self- loops (edges with both ends at the same vertex).
b. A graph with 3 connected components, 11 vertices, and 8 edges.
c. A graph with 3 connected components, 10 vertices, and 30 edges.
d. A graph with 3 connected components and 10 vertices. 9 vertices have degree 3 and 1 vertex has degree 4.
e. A graph with 6 vertices, of which 4 have degree 3, 1 has degree of 4 and 1 has degree 5.
What is the intrinsic value of this stock
: Your broker has recommended that you purchase stock in National Bank & Trust, Inc. National Bank & Trust recently paid its annual dividend ($5.00). Dividends have consistently grown at a rate of 3.10%. Based on your analysis, you estimate that the st..
|
Write the appropriate benders cut
: Suppose that a minimum makespan planning and scheduling problem is to be solved by logic-based Benders decomposition.
|
What of those requirements do you think should be changed
: Consider the requirements to serve in the House of Representatives and the Senate. What of those requirements do you think is a good idea? What of those requirements do you think should be changed? What requirements do think should be added to the..
|
How race would be explained using that perspective
: Summarize each of these perspectives and provide an example for each perspective of how race would be explained using that perspective
|
Describe greedy algorithm to make change consisting of dimes
: Describe a greedy algorithm to make change consisting of quarters, dimes, nickels, and pennies. Prove that your algorithm yields an optimal solution.
|
Write the appropriate benders cut
: Suppose that a minimum makespan planning and scheduling problem is to be solved by logic-based Benders decomposition.
|
Do you agree with what madison says is the best approach
: In Federalist 10, James Madison argues there are two ways to deal with "Factions". Dealing with the "causes" of factions OR controlling their "effect". Which way does Madison say is the best for dealing with the "mischiefs of factions"? Why does M..
|
Examine the historical role of the executive branch
: Examine the historical role of the executive branch in women's health care policy. What influence has this branch made on the current state of women's health in the United States
|
If the fund earns 10 percent interest compounded annually
: Your brother, who is 6 years old, just received a trust fund that will be worth $32,000 when he is 21 years old. If the fund earns 10 percent interest compounded annually, what is the value of the fund today?
|