CS 311: Data Structures II
Winter Quarter
2011
DESCRIPTION
This class is a continuation of CS 260. The topics
covered will include: file I/O in Java, internal and
external sorting algorithms, and grap
CS 311: Winter, 2011
Lab 2
Due: 2/18/11
This lab is practice in reading and writing binary files of integers. There will be an executable
jar file available called FileGenerator.jar. This program will
CS 311: Winter 2011
Assignment 1
Due: 2/9/11
This assignment involves profiling sorting algorithms. Profiling an algorithm means testing the
performance of an algorithm on sample data sets as opposed
CS 311
Graph Algorithms
Definitions
A Graph G = (V, E) where V is a set of
vertices and E is a set of edges,
An edge is a pair (u,v) where u,v V.
If the edges are ordered the graph is called
direct
File I/O in Java
CS 311, Winter 2011
File Basics
Recall that a file is block structured. What
does this mean?
What happens when an application opens
or closes a file?
Every OS has its own EOF chara
Revision: 1/19/2011
CS 311, Winter 2011
Sorting Lecture Notes
The Sorting Problem:
Given a set of records r1 , r2 ,., rn with corresponding key values k 1 , k 2 ,., k n , arrange the records
into an o
KEY
HOMEWORK 1 — Efﬁciency of Algorithms
PLEASE WRITE YOUR ANSWERS ON THIS SHEET. COPY QUESTIONS FROM THE BOOK AS NEEDED.
Problem 1. For each of the following, simplify or write in closed form if poss
KEY
HOMEWORK 3 — Graph Algorithms
PLEASE WRITE YOUR ANSWERS ON THIS SHEET. USE EXTRA BLANK PAGES FOR YOUR WORK IF
NEEDED.
Problem 1. Topological Sort: Show in complete detail the execution of a DFSba
KTY
HOME.WORK 4

String Data Structures and Algorithms
Pi,BasB wRrrE rrouR ANSwERS oN THrs SHEET. UsB BxrRa BLANK pAGES FoR youR woRK IF
NEEDED.
Problem 1. Ttie
Create a Tlie symbol table from the fo