Computer Science 130B Winter 2007 Homework #3 Due: 4pm, February 23th, Friday Problem 1 Consider a square lattice structure. A square lattice of size n2 is a directed labeled graph G = (V, E), where |V | = n2 . Vertices in a lattice are arranged in a
Computer Science 130B Winter 2007 Homework #2 Due: 4pm, February 2nd, Friday Problem 1 Consider the coin change problem. You are at a check out register, and have an unlimited supply of quarters, dimes, nickels, and pennies. You have to make a small
Computer Science 130B Winter 2007 Programming Assignment #4 Do not turn in. For your practice only Imagine a set of 8 plane patterns as shown in Figure 1(a). Each pattern differs in shape from the others but together they can be arranged to make diff
Problem (20%) Two character strings may have many common substrings. For example, photograph and tomography have several common substrings of length one, and common substrings of ph and to of length two, and ograph of length six, which is also the ma
Computer Science 130B Winter 2007 Programming Assignment #1 Due: 11:59pm, Friday January 26th Implement a divide-and-conquer algorithm for finding the convex hull of a set of 2D points. Your program should take inputs of the following format: n x1 y
Greedy Methods
Problems whose solutions can be "ranked"
Course selection Feasible stay on highway, don't spend more finish in 4 solutions finish in x days than one has years Optimal shortest distance, maximum returns, best solutions minimum time min
Backtracking
All the algorithm design techniques discussed so far rely on the problem to possess certain properties
Divide-and-Conquer
The problem is decomposable into smaller ones Smaller problems can be solved independently Solution can be constru
Computer Science 130B Winter 2007 Programming Assignment #3 Due: 11:59pm, Sunday March 4th Solve the same problem as in the previous assignment using dynamic programming. The need for a different solution arises because the greedy method does not gua
Sample Midterm Exam Questions for CS130B Data Structures and Computer Algorithms
Divide-and-Conquer The classical Towers of Hanoi problem begins with a stack of n 1 disks on one of three pegs. No two discs are the same size, and the discs are stack
Computer Science 130B Winter 2007 Homework #4 Due: 4pm, March 14th, Wednesday NOTE: Even though this is not a programming assignment, the quickest way to answer some of these questions is to write a simple program. If you answer any of the questions
Computer Science 130B Winter 2007 Written Assignment #1 Due: 4pm, January 19th, Friday Problem 1 In divide-and-conquer, the way a problem is divided into pieces often affects the effectiveness and applicability of the proposed solution. Consider the
Computer Science 130B Winter 2007 Programming Assignment #2 Due: 11:59pm, Friday February 9th In this and the next programming assignments, we are going to consider a problem that arises in medical image visualization, or more specifically, that of v