Optimal parenthesization of a matrix-chain product

Assignment Help Data Structure & Algorithms
Reference no: EM13807064

Part I:

1. Use the dynamic programming technique to find an optimal parenthesization of a matrix-chain product whose sequence of dimensions is <5, 10, 3, 12, 5, 50, 6>.

      Matrix             Dimension

      A1                   5 * 10

      A2                   10*3

      A3                   3*12

      A4                   12*5

      A5                   5*50

      A6                   50*6

You may do this either by implementing the MATRIX-CHAIN-ORDER   algorithm in the text or by simulating the algorithm by hand. In either case, show    the dynamic programming tables at the end of the computation.

2. We have 5 objects, and the weights and values are

No.      1          2          3          4          5

w         10        20        30        40        50

v          20        30        66        40        60

The knapsack can carry a weight not exceeding 100, find a subset items and give the total weight and value for following algorithms:

1) By using the algorithm of greedy of value for 0-1 knapsack problem? By selecting the highest value first.

2) By using the algorithm of greedy of weight for 0-1 knapsack problem? By selecting lightest item first.

3) By using the algorithm of greedy of density for 0-1 knapsack problem? By selecting the highest density item first.

4) By using the algorithm of greedy of density for fractional knapsack problem?  By selecting the highest density item first.

3. Using Floyd's algorithm, calculate the length of the shortest path between each pair of nodes in the graph by constructing a matrix. Give the each step of the adjacency matrix.

690_Floyd algorithm.png

Program Floyd's algorithm and use the graph of problem 3 in a driver program to test you answer.

Reference no: EM13807064

Questions Cloud

Paper on ethernet networking : Research paper should be on Ethernet Networking related to my specific subject which is Telecommunications and networking
Anth african studies reaction paper : Anth African Studies Reaction Paper.
Screen print of the schedule and gantt chart : Develop your small acquisition project schedule using MS Project (tasks, predecessors, duration, and resources assigned).
Write research paper about on othello by william shakespeare : Write a research paper about On Othello by William Shakespeare. What is the peculiarity of Othello? What is the distinctive impression that it leaves?
Optimal parenthesization of a matrix-chain product : Use the dynamic programming technique to find an optimal parenthesization of a matrix-chain product whose sequence of dimensions is
What are the key terms in a one sample verbal hypothesis tha : What are the key terms in a one sample verbal hypothesis that signify whether you are conducting a one-tailed or two-tailed test? Provide one example each for the use of one-tailed and two-tailed test and also state the Null and the Alternative hypot..
Problems on international air transport association survey : What is the probability that between 133 and 171 of the business travelers say that the reason for their most recent business trip was an internal company visit?
Evaluation and control-mergers and acquisitions : How are evaluation and control different for each stage of the strategic process (planning, implementation, evaluation, and control)? How are they similar? Respond substantively to at least two other students' posts.
Write a presentation paper about selling organs : Write a Presentation paper about "Selling Organs".

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  The greatest common divisor of the fibonacci number

what is the greatest common divisor of the fibonacci numbers f100 and f101 by Euclid algorithm

  Using quicksort with median-of-three

Show the steps in details of sorting {3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5} using quicksort with median-of-three partitioning and a cutoff 3 (if the elements are less than 3, using insertion sort).

  Create a loop structure to display all integer values

Determine if the first number is larger than, smaller than, or equal to the second number.

  Advantage of fast running time of insertion sort

Running time of quicksort can be enhanced in practice by taking advantage of fast running time of insertion sort when its input is "nearly" sorted.

  Finding approximation algorithm and ratio of the algorithm

finding approximation algorithm and the ratio of the algoirthm.

  Devise algorithm to generate access control matrix

Devise an algorithm that generates an access control matrix A for any given history matrix H of the Chinese Wall model. A significant portion of the grade for this problem involves your justification of your algorithm.

  Transmitting image using raster scan order

If we were to transmit this image using raster scan order, after 15 seconds how many rows of the image will the user have received?

  Creating a home inventory database

Construct one query of your selection. Remember a query answers a question. As an example, list all household electronics that are greater in value than $200.

  Data structures assignment requiring c++ program

You should build enough new roads such that if City A was reachable from City B via some old roads, City A must be reachable from City B via some new roads.

  Users and it organizations arm against phishing attacks

How users and IT organizations must arm themselves against these attacks?

  Created a linked list class

created a linkedlist class

  High bandwidth network for the multimedia team

Assume you have been assigned to build a network for a multimedia development company that currently uses a 10-Mbps Ethernet network. The corporation requires a high bandwidth network for multimedia team.

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