HW4 - Assignment #4, CS/531 Due Date: Mon. Nov. 7, 2011...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Assignment #4, CS/531 Due Date: Mon. Nov. 7, 2011 UNSUPPORTED SOLUTIONS RECEIVE NO CREDIT. Total points: 51 1 (7 pts). Maximum Contiguous Subsequence Sum Problem revisited. Let A [1 ..n ] be an array of numbers. The elements in A can be either positive or negative. We want to find the indices k,l so that the sum l i = k A [ i ] is maximum among all possible choices of k,l . For example if A = { 3 , 12 , 6 , 10 , 5 , 2 } , the answer is k = 2 ,l = 4, since A [2] + A [3] + A [4] = 12 + ( 6) + 10 = 16 is the maximum sum of all possible choices. This is exactly the problem 3 in HW2. However, this time you must describe an O ( n ) time algorithm for solving this problem. 2. (1 pt) Consider the graph G = ( V,E ) shown in Figure 1. The integers near an edge is its weight. Using Kruskals algorithm, compute the minimum spanning tree T 1 of G . List the edges of T 1 in the order they are added into T 1 . 5 3 2 6 4 7 1 8 6 3 4 2 a b c d e f h g Figure 1: Kruskals Algorithm. 3. (6 pts) For a given undirected, edge weighted graph G = ( V,E ), there might be more than one MST of G . This can happen if G has two edges e and e such that w ( e ) = w ( e ). In this case, when we run Kruskal algorithm on G , the edges e and...
View Full Document

This note was uploaded on 02/27/2012 for the course CSE 431/531 taught by Professor Xinhe during the Fall '11 term at SUNY Buffalo.

Page1 / 3

HW4 - Assignment #4, CS/531 Due Date: Mon. Nov. 7, 2011...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online