CS107 - Lab 1
Introduction to algorithmmic problem solving (part 1: basic instructions and ifthen-else)
1. Below are two shampooing algorithms. Which do you think is a better general-purpose
solution? Why? (Hint: What if you wanted to wash your hair 1000
csci 210: Data Structures Linked lists
Summary
Today
linked lists single-linked lists double-linked lists circular lists
READING:
GT textbook chapter 3
Arrays vs. Linked Lists
Weve seen arrays:
int[] a = new int[10]; a is a chunk of memory of size 1
Csci 210 Lab 5 & 6: Boggle
(Laura Toma adapted from Eric Chown)
Overview
In this assignment, you will implement the back-end logic for a graphical version of the popular
board game Boggle. Specifically, you will design and implement the algorithmes necess
Csci 210 Lab: Sudoku
(Laura Toma adapted from Eric Chown)
Overview
In this lab we are going to use search to solve the game Sudoku. In Sudoku the goal is to
complete a grid of numbers. When finished each row and column must include all of the
numbers 1 to
Csci 210: Tetris I
(Laura Toma adapted from Eric Chown based on a lab developed at Stanford by Nick Parlante)
Overview
In this lab you will start developing a Tetris game. The design will emphasize elemental Object
Oriented Programming (OOP) design - usin
Csci 210 Lab 1: Dot puzzles
(Laura Toma adapted from Eric Chown adapted from Northeastern University.)
Overview
In this laboratory, you will draw a series of 16 dot patterns using nested for loops. You may
think of the dot patterns as geometric puzzles to
Csci 210 Lab: Vizualizing Terrains
(Laura Toma)
Overview
Vast amounts of terrain data is available from remote sensing technology. Most data available is
in the form of aerial photographs. Photographs are a great tool for viewing, and they became now
stan
CSci 231 Homework 2
Recurrences
CLRS Chapter 4
Write and justify your answers on this sheet in the space provided.1
1. Solve the recurrence: T (n) =
Hint: use
1
n
2
i=1 i
=
1
if n = 1
T (n 1) + n(n 1) if n 2
n(n+1)(2n+1)
.
6
Collaboration is allowed, even
CPS 231 Homework 1
Insertion sort and Growth of Functions
CLRS Chapter 1, 2 and 3, Appendix A
Write and justify your answers on this sheet in the space provided.1
Exercises (suggested)
1. (CLRS 2.1-2) How do you modify the IN SERT ION SORT procedure to so
CSci 231 Homework 6
Red Black Trees
CLRS Chapter 13 and 14
1. Problem 13-1 (persistent dynamic sets).
2. Problem 13-3 (AVL trees) only part a and b.
3. In this problem we consider a data structure for maintaining a multi-set M . We want
to support the fol
CSci 231 Homework 7
Dynamic Programming and Greedy Algorithms
CLRS Chapter 15 and 16
Use a (single) separate sheet of paper for each problem. Be concise.
1. A game-board consists of a row of n elds, each consisting of two numbers. The rst
number can be an
CSci 231 Homework 9
Graph Algorithms
CLRS Chapter 22, 24
1. [22.1-5] The square of a directed graph G = (V, E) is a graph G2 = (V, E 2 ) such that (u, w) E 2 if
and only if, for some v V , both (u, v) E and (v, w) E. Thus, G2 contains an edge between u an
CSci 231 Homework 4
Selection and Divide-and-conquer
CLRS Chapter 9
1. (CLRS 9.3-5) Suppose that you have a black-box worst-case linear-time median subroutine.
Give a simple, linear-time algorithm that solves the selection problem SELECT(i) for an
arbitra
CSci 231 Homework 10
Graph Algorithms
CLRS Chapter 24, 25
1. (CLRS 25.2-4) We are given a directed graph G = (V, E) on which each edge (u, v) has an associated
value r(u, v), which is a real number in the range [0, 1] that represents the reliability of a
CS107 - Lab 1
In this lab you will cover:
Getting used to the computer
Using basic Unix commands
Creating a webpage
Begin to think about algorithmic problem solving
The reading for this lab is Chapter 1 in the textbook.
Getting used to the computer
Login
Lab 10
Overview: Computer Organization: Binary number representation, Boolean logic, circuits and
gates, machine language.
Problems
1. Consider the machine instruction 10001000000000010001, where 10001 is an opcode
indicating the STORE X command, meaning
CS107 - Lab 9
Overview: C+ functions and recursion.
As you write your programs remember to pay attention to the following issues of style:
On the first line in your program include a comment with your name and a short
description of what the program does.
CS107 - Lab 7
Overview
In this lab you will continue working with C+ functions. You will see problems that we have
not explicitly discussed in class. You are expected to learn and figure out how things work by
looking at the examples given throughout the
CS107 - Lab 8
Overview: In this lab you will continue working with C+ functions. You will see problems that
we have not explicitly discussed in class. You are expected to learn and figure out how things
work by looking at the examples given throughout the
CS107 - Lab 6
Overview
In this assignment you will work on C+ functions. You will see problems that we have not
explicitly discussed in class. You are expected to learn and figure out how things work by
looking at the examples given throughout the lab. Be
CS107 - Lab 4
Overview:
Some of the most important algorithms used in computing are in the category "search and sort."
These are useful in a variety of settings, such as web search, alphabetic sorting of a list of names,
etc. They are also related, since
CS107 - Lab 5
Overview:
This assignment exercises the basic elements of C+ programming. As you write your programs,
remember to pay attention to the following issues of style:
on the first line in your program include your name and a short description of