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?
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, determing 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 Big O?
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
effect of processor speed on time to complete an algorithm
Big O with multiple independent variables, e.g. matrix addition
logarithms
The summation of 1 to N, formula, implications
Big O space requirements of algorithms
Encapsulation
purpose of object based design and encapsualtion
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
dynamic allocation of objects. Object variables and actual objects
the implicit parameter this
toString methods
class methods and instance methods
accessing fields of the non calling object
immutable objects
throw exceptions
Inheritance
the is-a and has-a relationships
inheritance relations terminology
inheritance in Java, exactly 1 class
the Object class (cosmic super class, Big Bang of Java classes)
the real picture of objects
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
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
dynamic binding / dynamic dispatch
compiler vs. runtime method checks
genericity
class cast exception
Generics
implementing generic data types
use of raw data types, casting, type safety
Interfaces
define an interface
implement an interface
variables of interface types
the Comparable interface
the Collection interface
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 basic implementation of data structures
Maps, Sets
map and set operations
implement am unsorted and sorted set class
examples using sets and maps
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
break even 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
infix and postfix notation
conversion of infix expression to postfix expression
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
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 address vs. closed address
collision resolution
Graphs
implementation of graphs, adjacency matrix, lists of links
graph algorithms
B Trees
implementation of B Trees
B Tree algorithms
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