CS 314 Topics List
The following are the major topics and sub topics covered in CS314, Data Structures (Computer Programming 2). Students should understand all the topics listed. Exams will be based on these topics, but exams will not simply ask for the definition of the concept.
Prerequisite knowledge:
primitive data types
identifiers
variable declarations
local variables
variable scope
constants, final variables
mathematical expressions
precedence rules
mathematical operators
if, if else, if else if
Boolean expressions
Boolean operators
for loops
enhanced for loops (foreach loops)
while loops
method (procedure, function) headers
overloading methods
parameters and arguments
value parameters and reference parameters
return values
casting
implicit widening cast
explicit narrowing casts
preconditions, post conditions, assertions
import statements
Java packages
java.lang package
Strings
System.out.print and System.out.println methods
arrays, algorithms on arrays (1d and 2d arrays)
standard Java classes: String, System, Math,
Integer, Double, Character, Scanner, File, Arrays, ArrayList, Random
autoboxing
Object variable behavior in Java, what is a reference?
null, == vs. .equals
Objects and Classes, create a new class.
problem decomposition and abstraction, problem generalization
exceptions
Topics Covered in CS314:
Course Introduction
Complexity / Algorithm Analysis
formal definition of Big O
rules of algorithm analysis, what can be considered 1 executable statement or computation for our purposes?
application of Big O, determining t(N) for a piece of code, actual number of executable statements as a function of N
application of Big O, determining f(n) for a piece of code, approximate number of executable statements as a function of N
various Big O functions, O(1), O(logN), O(sqrt(N)), O(N), O(NlogN), O(Nsqrt(N)), O(N^2), O(N^3), O(N^x), O(2^N), O(x^N), O(N!)
given a piece of code, what is the order (most restrictive correct)?
given a Big O function, a value of N, and a runtime, what is the predicted runtime for different values of N?
best case, average case, and worst case performance of algorithms
effect of processor speed on time to complete an algorithm
Big O with multiple independent variables, e.g. matrix addition with an N by M matrix
logarithms
The summation of 1 to N, formula, implications
The summation of the geometric series 1 + 2 + 4 + 8 ... + N/ 8 + N/4 + N /2 + N
Big O space requirements of algorithms
Encapsulation
purpose of object based design and encapsulation
defining the interface for a new data type, behaviors
implementing a new data type, fields and methods
constructors
overloading constructors
the default constructor
this and constructor calls
instance variables vs. class variables (static)
final variables
initial values of instance variables
scope of instance variables
public vs. private, when to use and implication
planning for reuse
pre and post conditions, writing and checking
dynamic allocation of objects.
value types, reference types
the implicit parameter this
toString method
class methods and instance methods
accessing fields of the non calling object
immutable objects
throwing exceptions
Inheritance
the is-a and has-a relationships
inheritance relations terminology
inheritance in Java, exactly 1 class (no multiple inheritance of classes)
the Object class (root of the Java inheritance hierarchy)
the real picture of objects (inherited fields)
inherited behaviors from parents and ancestors
private and inheritance
protected and inheritance
multiple inheritance
class hierarchies
overriding methods
partially overriding methods, using super
use of the keyword super
specialization, adding methods and fields
final methods and classes
constructors and inheritance
chain of constructor calls during object initialization
using super to specify constructor called
lack of default constructor, implication for descendant classes
Polymorphism
object variables and polymorphism
implication of Object class, equals, toString, getClass
overriding the, equals and the difference between instanceof and this.getClass() == otherObject.getClass()
dynamic binding / dynamic dispatch, which method gets called at runtime?
compiler vs. runtime method checks
genericity
class cast exception
using the instanceof operator
Generics
implementing generic data types
use of raw data types, casting, type safety
erasure of generic type information
Interfaces
define an interface
implement an interface
variables of interface types
the Comparable interface
the Comparator interface
the Collection interface
default methods
Iterators
Iterable interface
Iterator interface
iterator methods: hasNext, next, remove
implement an iterator
nested and inner classes
Abstract Classes
reason for abstract classes
abstract methods
inheritance and abstract classes
object variables of abstract types
instantiation of abstract objects (not allowed)
abstract classes as skeletal implementation of data structures
Maps, Sets
map and set operations
implement an unsorted and sorted set class
examples using sets and maps
difference in speed of TreeMap and HashMap
Linked Lists
working with nodes
implement linked list operations
singly linked vs. doubly linked
order (Big O) of operations
comparison to array based lists
Recursion
the runtime stack
what happens when a method gets called
what happens when a method ends
concept of recursion
trace recursive methods
implement simple recursive methods
bases cases, identifying bases cases
recursive step, identifying and implementing recursive steps
Big O of recursive methods
Recursive Backtracking
brute force solutions
sudoku example
8 queens, n queens examples
searching a directory for files
implement recursive backtracking algorithms
Searching, Simple Sorts
algorithm for sequential search
when to use sequential search
algorithm for binary search
when to use binary search
breakeven point for sorting in order to do binary search
Big O for sequential and binary search
algorithms for simple, N^2, sorts: insertion sort, selection sort
best case / worst case performance of simple sorting algorithms
Stacks
Stack interface
implementations of stack
Big O of stack operations based on implementation
using stacks
print out contents of a stack
balanced symbol checking
evaluation of postfix expressions
solve problems using and involving stacks
Queues
Queue interface
implementations of queues
wraparound in native arrays
Big O of queues operations based on implementation
solve problems using and involving stacks
radix sort algorithm
Fast Sorting
algorithm for quicksort
algorithm for merge-sort
implementations of quicksort and mergesort
Big O for quicksort and mergesort
hybrid sorts
Trees
definition of rooted trees
full tree
complete tree
perfect tree
path length
depth
height
implementation of binary trees
tree traversals, preorder, in-order, post-order, level-order, results and implementations
solve problems using and involving binary trees
Binary Search Trees
accessing elements of a tree
naive insertion algorithm
naive deletion algorithm
effects on tree with multiple inserts and deletes
finding the depth of a node
finding the height of a tree
balanced binary search trees
Big O of operations on binary trees
solve problems using and involving binary search trees
Red-Black Trees
red-black trees, rules
insertion into a red-black tree
Heaps
heap implementation and algorithms
min heap vs. max heap
heapsort
priority queue interface and implementation
Hash tables
hash functions
hashcode and equals method in Java
implementation of hash tables, open addressing vs. closed addressing
collision resolution
Graphs
implementation of graphs, adjacency matrix, lists of links
graph algorithms including shortest path in unweighted graph, Dijkstra's algorithm for shortest path in weighted graph
minimum spanning trees, Prim's algorithm
Dynamic Programming
General skills
design and implement a class based on a problem description
decompose a problem into classes, implement classes to create a solution, create classes that may be reused
use existing classes to help solve a problem
use existing classes and operations from those classes based on documentation
design an interface
implement an interface
extend classes using inheritance
determine errors in existing code (syntax errors, runtime errors, logic errors)
determine the purpose of a given piece of code
extend a given piece of code
use pre and post conditions for methods and behaviors
write pre conditions, post conditions, and assertions for code
debug code using a debugger
debug code by eye
trace code and what the value of variables are at various points in the execution
implement new data structures
use new data structures to solve problems