Unformatted text preview: COT 5405 Analysis of Algorithms, Fall 2006. Homework 4 Due Wednesday, December 6 2006, before 11:59pm Dr. Banerjee will explain in the last class why the deadline was “officially” advanced. 1. [1 page] There is a strange species of fish where a parent fish would eat up its own immediate offspring fishes if they come in contact. Now, you are given a single big family of fishes of different weights (including the greatest ancestor of the family). Your job is to design an algorithm to select a bunch of fishes for your aquarium with the constraint that none of them would eat each other and their total weight is maximized. You can assume a tree model for representing the parent-child relationship. Derive the time complexity of your algorithm. As for example, here the possible grouping of fishes who can peacefully co-exist are (A, D, E, F, G, H) or (B, C) or (B, F, G, H) or (C, D, E) or any of their subsets....
View Full Document
- Fall '08
- Algorithms, Big O notation, Analysis of algorithms, Computational complexity theory, xij, Dr. Banerjee, substring inversions