CS 311: Data Structures II
This class is a continuation of CS 260. The topics
covered will include: file I/O in Java, internal and
external sorting algorithms, and graph algorithms and
applications. Prerequisite: CS 260
CS 311: Winter, 2011
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 generate binary files of random
integers that can be u
CS 311: Winter 2011
This assignment involves profiling sorting algorithms. Profiling an algorithm means testing the
performance of an algorithm on sample data sets as opposed to doing a mathematical analysis of
the algorithm. The
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
directed. Sometimes called a Digraph.
Vertex v is adjacent t
File I/O in Java
CS 311, Winter 2011
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 character and,
for text files, its own EOL character(s).
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 order A such that records rA1 , rA 2 ,., rA n have keys
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 possible.
\ 50L» 2 2 7.
Zen + 2)
HOMEWORK 3 — Graph Algorithms
PLEASE WRITE YOUR ANSWERS ON THIS SHEET. USE EXTRA BLANK PAGES FOR YOUR WORK IF
Problem 1. Topological Sort: Show in complete detail the execution of a DFS-based Topological Sort
on the following graph. Show your
String Data Structures and Algorithms
Pi,BasB wRrrE rrouR ANSwERS oN THrs SHEET. UsB BxrRa BLANK pAGES FoR youR woRK IF
Problem 1. Ttie
Create a Tlie symbol table from the following word value pairs. Add them one by one, top to