ProgAsnmnt2

# ProgAsnmnt2 - Programming assignment 2.2: [10] Implement...

This preview shows page 1. Sign up to view the full content.

Due: 11/06/08 [30] Programming assignment 2.1 (modified from Programming Assignment 1): [Points: 15] For the Binary-Search-Tree-Organization problem implement both the Memoization (DP recursively calculating only those elements needed for the final computation, not the whole triangular matrix), and the Dynamic Programming (non-recursive, bottom-up and purely table-based) algorithms. Only compute the final cost value. Compare the relative empirical asymptotic time complexities (i.e., their growth with respect to the problem size) of the two algorithms. The input should not be hard coded. Apart from the run-time needed for complexity analysis, output the final aggregate cost of the optimum tree for each/some input to show that your algorithms work correctly. Submission: the commented source codes, and the complexity analysis. If you have used any clever data structure in implementing the Memoization algorithm for better efficiency, then discuss that in the report.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Programming assignment 2.2: [10] Implement the Floyd-Warshall All-pairs-shortest path algorithm for directed weighted graph that may have negative weights. Run it for the following three input graphs: All positive weights: (a, b, 3), (a, c, 8), (a, e, 4), (b, d, 1), (b, e, 7), (c, b, 4), (d, c, 5), (d, a, 2), (e, d, 6) Some negative weights but no negative cycle: (a, b, 3), (a, c, 8), (a, e, -4), (b, d, 1), (b, e, 7), (c, b, 4), (d, c, -5), (d, a, 2), (e, d, 6) Negative cycle may exist: (a, b, 3), (a, c, 8), (a, e, -4), (b, d, 1), (b, e, 7), (c, b, -4), (d, c, -5), (d, a, 2), (e, d, 6) Submission in hard copy: the commented source code, intermediate distance matrices for each run, and a short report. Complexity analysis is not necessary. Programming assignment 2.3: [5] Improve the algorithm to output a negative cycle for the third case if it exists. You may embed your code and report within that from the previous assignment....
View Full Document

## This note was uploaded on 02/10/2012 for the course CSE 5211 taught by Professor Dmitra during the Spring '12 term at FIT.

Ask a homework question - tutors are online