Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

539_Tree.jpg

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91924225

Have any Question?


Related Questions in Computer Engineering

Questionhow can you start business by mobile application

Question How can you start business by Mobile Application Development ? Discuss the testing process of Mobile Applications in detail ? List important steps for publishing an app in the Target Market ?

Quesiton direct manipulation and virtual environments

Quesiton: "Direct Manipulation and Virtual Environments" Please respond to the following: • Your software development company has been contracted to build a tool that will manage user accounts and rights in an Active Dir ...

A student is applying to harvard and dartmouth if the

A student is applying to Harvard and Dartmouth. If the student is accepted at Dartmouth, the probability of being accepted at Harvard is 40%. If the student is not accepted at Dartmouth there is an 80% of non-acceptance ...

When talking about economics and the history of it for the

When talking about Economics and the history of it. For the past recessions the U.S. has had, do we look at it mostly on the loan side of the banks or what causes most recessions?

Listen to or read the transcript of this podcast

Listen to (or read the transcript of) this podcast (https://www.stlouisfed.org/education/economic-lowdown-podcast-series/episode-16-elasticity-of-demand) from the Federal Reserve Bank of St. Louis. describe your experien ...

Question 1a major department store chain is interested in

QUESTION 1 A major department store chain is interested in estimating the average amount its credit card customers spent on their first visit to the chain's new store in the mall. Fifteen credit card accounts were random ...

How is the study of how firms decisions about prices and

How is the study of how firms' decisions about prices and quantities depend on the market conditions they face, the field of industrial organization, and the cost of production.

The stock of company tyk pays dividends annually with next

The stock of company TYK pays dividends annually, with next year's dividend expected to be $1 a share. For the next seven years, dividends are expected to grow at a rate of 6% a year. Thereafter, dividends are expected t ...

What are the three most significant aspects of threat which

What are the three most significant aspects of threat which will continue to evolve for the next 20 years?

Sum of consecutive integersa write a program that prompts

Sum of consecutive integers A) Write a program that prompts for an integer-let's call it X-and then finds the sum of X consecutive integers starting at 1. That is, if X = 5, you will find the sum of1+2+3+4+5=15 B) Modify ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As