600.226: Data Structures
Spring Semester 2006: January 30, 2006 - May 5, 2006
Contents
Catalog Description:
This course covers
the design and implementation of data structures
including arrays, stacks, queues, linked lists, binary trees,
heaps, balanced trees (e.g. 2-3 trees, AVL-trees) and graphs.
Other topics include sorting, hashing, memory allocation, and
garbage collection.
Course work involves both written homework and
Java programming assignments.
Prerequisite(s):
600.107: Introduction to Programming in Java (preferred) or
600.109: Introduction to Programming in C/C++;
600.120: Intermediate Programming can be helpful as well.
Academic Honesty:
It is your responsibility to adhere to the
Department
Integrity Code and other applicable university regulations.
Feel free to email us your questions or concerns.
Discussion List:
cs226-discuss@bloat.org
(open discussion, but you must subscribe
here
first)
Staff List:
cs226-staff@bloat.org
(to contact all of us, but only staff can subscribe)
Submit Assignment:
cs226-submit@bloat.org
(we grade your last submission
before the deadline)
Lecture:
Thursday & Friday, 9:00 am - 10:15 am
Location:
303
Shaffer Hall
Discussion:
Monday, noon - 1:00 pm
Location:
317
New Engineering Building
Final Exam:
Thursday, May 18, 9:00 am - 12:00 noon
Instructor:
Peter Fröhlich
Office Hours:
Thursday & Friday, 11:00 am - 12:00 noon
Location:
326
New Engineering Building
Teaching Assistant:
Daniel Abretske
Office Hours:
Monday, Tuesday, Wednesday, Friday, noon - 1:00 pm
Location:
225
New Engineering Building
Course Assistant:
Huan He
Office Hours:
Tuesday, 4:00 pm - 5:00 pm
Location:
225
New Engineering Building
Course Assistant:
Jonathan Lasko
Office Hours:
Tuesday, 2:00 pm - 3:00 pm
Location:
225
New Engineering Building
Course Assistant:
Wei Chen
Office Hours:
Monday, 2:00 pm - 3:00 pm
Location:
225
New Engineering Building
Week 1: Introduction and Overview (January 30 - February 5)
Lecture:
- Thursday: Welcome to Data Structures (and Algorithms :-)
- Friday: Review of Object-Oriented Programming
Reading:
Deadlines:
-
Thursday:
Grab Assignment 1 and get started.
-
Friday:
Introduce yourself on the course mailing list.
(Graded)
Week 2: Theoretical Background (February 6 - February 12)
Lecture:
-
Thursday:
Specification of Abstract Data Types
[Handout]
-
Friday:
Basics of Algorithm Analysis
(Daniel Abretske)
Reading:
Deadlines:
-
Wednesday:
Turn in your solution to Assignment 1.
-
Thursday:
Grab Assignment 2 and get started.
-
Friday:
Take and defend a position regarding "What's better? Asymptotic or Experimental Analysis?" on the course mailing list; discuss.
(Graded)
Week 3: Fundamental Data Structures (February 13 - February 19)
Lecture:
-
Thursday:
ADT Redux:
Testing and Abstract Data Types,
Interfaces versus Specifications;
Stacks (Specification and Implementation)
-
Friday:
Review of Generics,
Implementation of Stacks;
Bounded versus Unbounded Stacks;
Growing Arrays and Amortized Analysis;
Queues and Deques
Reading:
Deadlines:
-
Wednesday:
Turn in your solution to Assignment 2.
-
Thursday:
Grab Assignment 3 and get started.
-
Friday:
Take and defend a position regarding
"Peter is nuts! Distinguishing bounded and unbounded stacks with
separate Java interfaces is overkill."
on the course mailing list; discuss.
The code for this is in the
archive for Assignment 3.
Some background reading (if you feel like it):
The Liskov Substitution Principle (LSP) is summarized
here;
specific examples are discussed in
this paper.
(Graded)
Week 4: Linear Data Structures (February 20 - February 26)
Lecture:
- Thursday: Overview of Position-based Data Structures; Arrays as Interfaces with Integer Positions; Arrays versus Lists; Abstract Positions; Design of List and Position Interfaces
- Friday: Nested Classes, Iterators, Reference Counting
Reading:
-
Required: Goodrich 6: Lists and Iterators
-
Optional: Unrolled Linked Lists; in Scheme (almost) everything is a list (or a function, depending on how you look at it)
Deadlines:
-
Wednesday:
Turn in your solution to Assignment 3.
-
Thursday:
Grab Assignment 4 and get started.
-
Friday:
Read up on XOR
Linked Lists.
Discuss on the mailing list under what circumstances it might be a
good idea to use this data structure.
How would you implement the position or iterator abstraction?
Is it possible to implement this data structure in Java?
(Graded)
Week 5: Hierarchical Data Structures (February 27 - March 5)
Lecture:
-
Thursday:
Introduction to Trees, Terminology,
General Trees, Binary Trees,
Implementation Sketch, Interface Design
-
Friday:
More on Implementation,
Tree Traversals,
Parameterized Traversals and the Template Method Pattern
Reading:
-
Required:
Goodrich 7: Trees
Deadlines:
Week 6: Graph Data Structures (March 6 - March 12)
Lecture:
-
Thursday:
Introduction to Graphs, Terminology,
Interface Design, Implementation Options
-
Friday:
[Midterm 1],
Graph Traversals: Depth First Search, Breadth First Search, Applications
(Daniel Abretske)
Reading:
Deadlines:
-
Wednesday:
Grab Assignment 6 and get started.
-
Friday:
Turn in your solution to Assignment 5.
-
Friday:
Present an application of graphs on the course mailing list. It's up
to you which application to present, but you have to present something
that nobody else has presented on the mailing list before.
If you post something and then find that someone else posted the same
application earlier (perhaps while you were still working on your email)
you have to find a new application to present. However, once you have
presented an application, you can post more details about it any time
before Friday is over.
If you get your application from an online source, cite the source and
give a URL for it.
It's okay to present an application from the text book or from lecture as
well...
(Graded)
Week 7: Sets and Priority Queues (March 13 - March 19)
Lecture:
-
Thursday:
Value-based Data Structures,
Sets as Abstract Data Types,
Multisets,
Basic Implementations,
Ordered Sets,
Self-Organizing Sets: Move-to-Front and Transpose Heuristics
-
Friday:
Ordered Sets with Minimum and Maximum,
Heaps,
Priority Queues
Reading:
-
Required:
Goodrich 8: Priority Queues;
11.6 for a different take on sets;
13.6 and 13.7 to see where priority queues are useful
-
Optional:
Check out this representation for
sets of integers;
think about how to do this in Java maybe? :-)
Deadlines:
-
Wednesday:
Turn in your solution to Assignment 6.
-
Thursday:
Grab Assignment 7 and get started.
-
Friday:
Email us a confirmation
that you found your partner. The subject should be
"Partners (Your Name)" and you should CC: your partner as well.
We need mutual confirmation,
so everybody needs to send this,
not just one person of the pair. (Graded)
-
Friday:
Discuss the Move-to-Front and Transpose heuristics for implementing
self-organizing sets on the course mailing list. Outline under what
assumptions you should go for self-organizing sets and how you would
decide whether to use Move-to-Front or Transpose for a particular
application. If you find other heuristics online, feel free to discuss
those as well, but cite your sources! (Graded)
Week 8: Spring Break (March 20 - March 26)
Week 9: Maps and Hash Tables (March 27 - April 2)
Lecture:
-
Thursday:
Maps as Abstract Data Types, Interface Design, Introduction to Hash Tables
-
Friday:
Hash Table Implementation, Hash Functions, Collisions, Rehashing, Universal
and Perfect Hashing (Overview)
Reading:
-
Required:
Goodrich 9: Maps and Hash Tables
-
Optional:
Bloom Filters
are another cool data structure based on hashing
Deadlines:
-
Thursday:
Turn in your solution to Assignment 7.
-
Friday:
Grab Assignment 8 and get started.
-
Sunday:
Email us
your
peer review
for
Assignment 7.
The subject should be
cs226-peer-7-login
where
login
is replaced by your login name on the
ugradx.cs.jhu.edu
server.
Read the
instructions
carefully and don't forget to give yourself a score
as well.
Week 10: Search Trees (April 3 - April 9)
Lecture:
-
Thursday:
Ordered Maps,
Introduction to Search Trees,
Binary Search Trees,
Introduction to AVL Trees
-
Friday:
Details on AVL Trees,
Overview of (2,3) Trees
Reading:
-
Required:
Goodrich 10: Search Trees
-
Optional:
Check out
Randomized Binary Search Trees
(which are very different from plain binary search
trees on which insertions are performed in random order).
Nice applet too... :-) Speaking of applets, check out this
Beautiful Balanced Tree Applet,
it can be quite helpful...
Deadlines:
-
Thursday:
Turn in your solution to Assignment 8.
-
Friday:
Grab Assignment 9 and get started.
-
Friday:
Can you come up with a good data structure to implement ordered sets
(or ordered maps, doesn't really matter) with both
minimum() and maximum()
operations that run in O(1)?
The hard part is that insert() should be
faster than O(n) somehow...
Explain your idea for a good data structure on the
discussion list, and feel free to point out the shortcomings of
other proposals. If you don't think it can be done, explain why!
(Graded).
-
Sunday:
Email us
your
peer review
for
Assignment 8.
The subject should be
cs226-peer-8-login
where
login
is replaced by your login name on the
ugradx.cs.jhu.edu
server.
Read the
instructions
carefully and don't forget to give yourself a score
as well.
Week 11: Sorting and Selection (April 10 - April 16)
Lecture:
-
Thursday:
Project Introduction,
Subversion,
Heap Sort
-
Friday:
[Midterm 2],
Quick Sort, Merge Sort
Reading:
-
Required: Goodrich 11: Sorting and Selection
-
Optional:
Review Goodrich 1-10, 13 for Midterm
-
Old Midterm:
[Fall 2005]
Deadlines:
-
Friday:
Grab Assignment 10, the first part of
the "big project," and get started.
-
Friday:
Turn in your solution to Assignment 9.
-
Friday:
Email us your team
registration:
Name of your team,
names and email addresses for all members
(three members in a team by default),
and three possible meeting time slots
(as detailed on the mailing list)
in order of preference.
(Graded)
-
Sunday:
Email us
your
peer review
for
Assignment 9.
The subject should be
cs226-peer-9-login
where
login
is replaced by your login name on the
ugradx.cs.jhu.edu
server.
Read the
instructions
carefully and don't forget to give yourself a score
as well.
Week 12: Text Processing (April 17 - April 23)
Lecture:
-
Thursday:
Text Processing Overview,
Naive String Matching,
Compression Basics,
Huffman Coding
-
Friday:
Knuth-Morris-Pratt String Matching,
Lempel-Ziv Compression
Reading:
-
Required: Goodrich 12: Text Processing
Deadlines:
-
Friday:
Turn in your team's solution to
Assignment 10.
-
Friday:
Grab Assignment 11, the second part of
the "big project," and get started.
-
Sunday:
Email us
your
peer review
for
Assignment 10.
The subject should be
cs226-peer-10-login
where
login
is replaced by your login name on the
ugradx.cs.jhu.edu
server.
Read the
instructions
carefully and don't forget to give yourself a score
as well.
Week 13: Memory Management & File Processing (April 24 - April 30)
Lecture:
-
Thursday:
Overview of Memory Management & Garbage Collection
-
Friday:
More Garbage Collection, Caching, Sorting Files, Outline of Indexed
Files and B-Trees
Reading:
Deadlines:
-
Friday:
Turn in your team's solution to
Assignment 11.
-
Friday:
Grab Assignment 12, the third and final
part of the "big project," and get started.
-
Friday:
Proper use of
Subversion
for developing your project, not just
as a backup storage system. (Graded)
-
Sunday:
Email us
your
peer review
for
Assignment 11.
The subject should be
cs226-peer-11-login
where
login
is replaced by your login name on the
ugradx.cs.jhu.edu
server.
Read the
instructions
carefully and don't forget to give yourself a score
as well.
Week 14: Review and Outlook (May 1 - May 5)
Lecture:
-
Thursday:
Review of Course Material,
Outlook on even more Data Structures
-
Friday:
Final Presentations (Graded)
Reading:
Deadlines:
-
Friday:
Turn in your team's solution to
Assignment 12.
-
Friday:
Post your opinion of the
ACM Code of Ethics and Professional Conduct
on the discussion list.
You don't have to discuss every single point, just post
your general impression and maybe pick one or two points
where you provide more detail.
(Graded)
-
Sunday:
Email us
your
peer review
for
Assignment 12.
The subject should be
cs226-peer-12-login
where
login
is replaced by your login name on the
ugradx.cs.jhu.edu
server.
Read the
instructions
carefully and don't forget to give yourself a score
as well.
Books
While there are lots of useful books for this course, the most
important one is the following required text
on algorithms and data structures.
We will be using Java exclusively, so getting the Java version
is highly recommended.
The following books are not required but make
for good reading anyway.
The first is a recent classic, and a reference that can serve
you throughout your career (or at least in 600.363/463 :-).
It uses pseudo-code throughout and takes quite a different approach
overall; it is also much, much longer.
Comparatively few people seem to know about the following book,
but I like it quite a bit.
It also uses pseudo-code instead of any particular language, but
it is relatively concise.
Speaking of concise, the following book is the most
concise text on advanced data structures that I know of; it is also
a joy to read, although not necessarily the first time you try.
Since we will be using Java exclusively in the course, and
since the required text only introduces the bare minimum,
it might be a good idea to have some Java text handy as
well. Here are a few options, the first one probably being
the most useful.
The following is a popular Java text as well, and it's
available for free. In don't like big books very much,
but at least this one has a decent reputation. :-)
The official language specification for Java is a good
resource to have around, but you can easily access it
online, no need to shell out money.
The official tutorial is slightly out-of-date, but if
you have a lot of catching up to do, you won't really
care.
-
James Gosling,
Bill Joy,
Guy L. Steele Jr.,
Gilad Bracha:
The Java Language Specification,
Addison-Wesley, 3rd edition, 2005.
[Buy]
-
Mary Campione, Kathy Walrath, Alison Huml:
The Java Tutorial,
Addison-Wesley, 3rd edition, 2000.
[Buy]
If you already know Java but need a concise reference to
carry around without building up more muscle (i.e. something
that actually fits into the proverbial
nutshell) check this one out:
If you are looking for a concise summary of good Java programming
style, the following short booklet comes in handy.
Finally three more general books on programming and software
development, all highly recommended (not just for this course);
the last one can be particularly useful if you're interested
in design issues, and I will sometimes take examples from it.
This list is hardly exhaustive.
Feel free to email me suggestions if you find a good book on any of
the topics we deal with in the course. :-)
Previous Offerings
Standards
Programming Style
When it comes to issues of programming style, it's more important
to develop some consistent style than to develop
any particular style; this is different in team
projects of course, here everyone should agree on a common style.
In terms of grading, the safest thing is to pick a style advocated
by some "authoritative" entity (without "mixing and matching" of
course); here are some possible style guides.
If you are thinking "Safety first!" pick either the first or the
second. The fourth has lots of nice reasoning in
it, useful if you are ever asked to define a style for a team.
Animations
Miscellaneous
Tools
Assignments (about 12): 50%,
Midterms (2): 20%,
Final (1): 20%,
Participation: 5%,
Peer Review: 5%.
Updated:
$Id: index.html 497 2006-09-07 04:31:59Z phf $
Validate:
XHTML
CSS
Copyright © 2002-2006
Peter H. Fröhlich.
All rights reserved.