Computational Geometry
The systematic study of algorithms and data structures for
geometric objects, with a focus on exact algorithms that are
asymptotically fast.
Two key ingredients of a good algorithmic solution:
Thorough understanding of the problem
Com S 228: Introduction to Data Structures
Instructors
Jeremy Sheaffer
Office: 110 Atanasoff Hall
Lecture: MWF 8:00am-8:50am
Ofce Hours: TBA
Xiaoqiu (Siaochcw) Huang
Ofce: 205 Atanaso' Hall
Lecture: MWF 11:00am-llc50am
Email: sheafferiastateedu
Phone: 294
Final Exam for Com S 228 Spring 2016
Name:
University ID:
There are 10 pages and 5 questions. Please start with easy questions. We will give
partial credit for a partially correct solution. You are not allowed to use any books,
notes, calculators, or elec
Exam 2 for Com S 228 Spring 2016 on March 24, 2016
Name:
University ID:
Recitation section (please circle one):
Section
Section
Section
Section
Section
Section
Section
1
2
3
4
5
6
7
R
R
R
R
R
T
T
10:00am-10:50am
2:10pm-3:00pm
1:10pm-2:00pm
4:10am-5:00am
3
Solution to Exam 1 for Com S 228 Spring 2016 on February 17, 2016
Name:
University ID:
Recitation section (please circle one):
Section
Section
Section
Section
Section
Section
Section
1
2
3
4
5
6
7
R
R
R
R
R
T
T
10:00am-10:50am
2:10pm-3:00pm
1:10pm-2:00pm
Ten Great Writers who cudtn even Spell
number 4 made me lol!
Assigned October 29, 2014
Due 23:59:00 November 12, 2014
Fainali, xen, aafte sam 20 iers ov orxogrefkl riform, wi wud hev a lojikl, kohirnt
speling in ius xrewawt xe Ingliy-spiking
werld.
Trees
Com S 228 Spring 2016
Assignment 3: A Chunky List
Due at 11:50 pm
Thursday, March 10
1. Introduction
This assignment gives you opportunities to develop your programming and debugging skills in working
with a linked data structure and to become familiar wi
COM S 228, Spring 2016
Programming Project 2
Sorting and Searching
Problem Overview
Sorting is of enormous importance in the practice of computing. Rare is the application that does not include sorting in its implementation. Everything from word processin
Com S 228 Spring 2016
Assignment 1: Biosequence Class Hierarchy
Due at 11:50 pm on Thursday, February 4
Introduction
This assignment gives you opportunities to organize biosequence data and operations
by using object-oriented concepts in Java according to
Com S 228 Spring 2016
Assignment 5: Dijkstras Algorithm for Solving
Mazes
Due at 11:50 pm on Thursday, April 21
Introduction
This assignment gives you opportunities to develop your programming skills in implementing a graph algorithm for finding a shortes
CS 228: Introduction to Data Structures
Lecture 16
Monday, February 23, 2015
The AbstractCollection<E> Class
AbstractCollection<E> is a generic abstract class
that implements of all the methods of Collection<E>,
except size() and iterator(). It serves as
CS 228: Introduction to Data Structures
Lecture 15
Monday, February 16, 2015
Creating a Generic Array
As we saw last time, because of erasure
E foo = (E) bar;
/ unchecked warning
is essentially equivalent to the code
Object foo = (Object) bar;
Still, in o
CS 228: Introduction to Data Structures
Lecture 14
Friday, February 13, 2015
Wild Cards and Bounds
As we have seen, generic sorting methods typically come
in one of two forms, corresponding to two ways of
comparing objects in Java.
1. For an existing clas
Homework 1
Pengqing Xie
1. a) ATmega128 which made by Atmel Corporation, and its CPU frequency is 16MHz.
b) Program Memory: 128K bytes On-chip In-System Reprogrammable Flash memory
for program storage
SRAM Data Memory: 4K bytes, The ATmega128 supports two
Assigned: 01/19/09
Due: 01/26/09
CprE 288 Spring 2010
Homework 1
NOTE: The homework is due in the class on the due date. Homework answers must be
typed using a word editor. Handwritten answers will not be accepted. A hard copy is
required for in-class sub
Assigned: 02/02/10
Due: 02/09/10
CprE 288 Spring 2010
Homework 3
Name: Pengqing Xie
Section: B
NOTE: The homework is due in the class on the due date. Homework answers must be
typed using a word editor. Handwritten answers will not be accepted. A hard cop
Balanced Trees
Balanced trees have height
Height-balanced trees
At each node, height of left and right subtrees are close.
e.g. AVL trees, B-trees, red-black trees, splay trees
Weight-balanced trees
At each node, number of nodes in left and right subtrees
(Notes partially modified from Dr. Fernandez-Bacas)
Graph
A graphis a set of vertices (nodes) and a set of
edges which are pairs of vertices.
vertex
edge
12 vertices
13 edges
A Directed Graph
In a directed graph (digraph), edges are ordered pairs.
DL 435
Edge Relaxation
Test if the shortest path to found so far can be improved by
going through .
w
Relax u, v
if
then
pred() =
Shortest path algorithms differ in
the number of times the edges are
relaxed and the order in which they
are relaxed.
pred(v)
u
pred
Depth-First Search
Idea: Keep going forward as long as there are unseen nodes
to be visited. Backtrack when stuck.
is completely traversed
before exploring and .
Color Map & Predecessor
Just like in BFS:
color() = green: is undiscovered and unprocessed
Graph Traversals
Visit vertices of a graph to determine some property:
Is connected?
Is there a path from vertex to vertex ?
Does have a cycle?
Will removing a single edge disconnect ?
If is directed, what are the strongly connected components?
If is the
Infix Notation
Each binary operator is placed between its operands.
Each unary operator precedes its operand.
-2 + 3 * 5
(-2) + (3 * 5)
Postfix expressions are easy to evaluate:
no subexpressions
precedence among operators already accounted for
But this i
Map
k 2 v2
k1 v1
k3 v3
If keys are integers in a small range,
use an array indexed by key.
v2
v1
v3
k2
k1
k3
What if keys are from a large range or not even integers?
Hash Tables
A hash table is a lookup table that acts as if it had random access into
an
Binary Search Trees
Storage of elements for efficient access.
Support for dynamic set operations.
The binary-search-tree property (satisfied at every node):
1. The data (or key) values in the left subtree are less than
the value of the node.
2. The data (
Preorder Traversal
1. Visit the node.
2. Traverse the left subtree.
3. Traverse the right subtree.
a
Traversal order: abdce
b
c
d
e
Notes by Yan-Bin Jia
Postorder Traversal
1. Traverse the left subtree.
2. Traverse the right subtree.
3. Visit the node.
a
Open Quick Links
Quick Links
Page Landmarks
Content Outline
Keyboard Shortcuts
Logout
Global Menu
Luke SternhagenActivity Updates
Home
Help
Top Frame Tabs
My ISU Tab Courses Tab 2 of
1 of 6
6 (active tab)
Organizations Tab Content Collection
3 of 6
Tab
Assigned: 01/26/10
Due: 02/02/10
CprE 288 Spring 2010
Homework 2
Name:
Section:
NOTE: The homework is due in the class on the due date. Homework answers must be
typed using a word editor. Handwritten answers will not be accepted. A hard copy is
required f
Assigned: 02/09/10
Due: 02/16/10
CprE 288 Spring 2010
Homework 4
Name: Pengqing Xie
Section: B
NOTE: The homework is due in the class on the due date. Homework answers must be
typed using a word editor. Handwritten answers will not be accepted. A hard cop
Procedure-Based Programming
main()
func1()
func2()
.
first function invoked
at execution
func3()
func4()
The functions within a program communicate through values
that they receive and return.
Application: Banking
Maintain a collection of bank accounts
st