CSE 2320
is the introductory course in algorithms and data structures. This page
provides access to documents and code for the course.
Documents
- Spring 2020 Syllabus
PDF, doc
- Notes 1 - Algorithmic Concepts
PDF, doc (updated 8/01/19)
- Notes 2 - Growth of Functions
PDF, doc (updated 8/27/18)
- Notes 3 - Summations
PDF, doc (updated 8/31/18)
- Notes 4 - Recurrences
PDF, doc (updated 1/08/19)
- Notes 5 - Heaps and Priority Queues
PDF, doc (updated 1/16/20)
- Notes 6 - Greedy Algorithms
PDF, doc (updated 9/12/18)
- Notes 7 - Dynamic Programming
PDF, doc (updated 1/16/20)
- Notes 8 - Sorting
PDF, doc (updated 10/03/18)
- Notes 9 - Linked Lists
PDF, doc (updated 1/16/20)
- Notes 10 - Stacks & Queues
PDF, doc (updated 1/16/20)
- Notes 11 - Rooted Trees
PDF, doc (updated 1/16/20)
- Notes 12 - Red-Black Trees
PDF, doc (updated 10/21/18)
- Notes 13 - Hashing
PDF, doc (updated 10/30/18)
- Dynamic Double Hashing (aside)
PDF, doc
- Notes 14 - Graph Representations and Search
PDF, doc (updated 11/04/18)
- Notes 15 - Minimum Spanning Trees
PDF, doc (updated 11/12/18)
- Notes 16 - Shortest Paths
PDF, doc (updated 11/17/18)
- Notes 17 - Network Flows and Bipartite Matching
PDF, docx (updated 1/16/20)
- Notes 18 - KMP String Search
PDF, doc (optional topic)
- Homework 1 problems PDF, doc
- Homework 1 answers PDF, doc
- Homework 2 problems PDF, doc
- Homework 2 answers PDF, doc
- Homework 3 problems PDF, doc
- Homework 3 answers PDF, doc
- Spring 19 exam questions
PDF, doc
- Fall 18 exam questions
PDF, doc
- Summer 18 exam questions
PDF, doc
- Spring 15 exam questions
PDF, doc
- Fall 14 exam questions
PDF, doc
- Spring 14 exam questions
PDF, doc
- Fall 13 exam questions
PDF, doc
- Summer 13 exam questions
PDF, doc
- Spring 13 questions
PDF, doc
- Fall 12 exam questions
PDF, doc
- Summer 12 exam questions
PDF, doc
- Spring 12-001 exam questions
PDF, doc
- Spring 12-002 exam questions
PDF, doc
- Fall 11 exam questions
PDF, doc
- Summer 11 exam questions
PDF, doc
- Fall 10 exam questions
PDF, doc
- Spring 10 exam questions
PDF, doc
- Fall 09 exam questions
PDF, doc
- Summer 09 exam questions
PDF, doc
- Fall 08 exam questions
PDF, doc
- Summer 08 exam questions
PDF, doc
- Spring 08 exam questions
PDF, doc
- Fall 07 exam questions
PDF, doc
- Summer 07 exam questions
PDF, doc
- Spring 07 exam questions
PDF, doc
- Fall 06 exam questions
PDF, doc
- Summer 06 exam questions
PDF, doc
- Spring 06 exam questions
PDF, doc
- Fall 05 exam questions
PDF, doc
- Summer 05 exam questions
PDF, doc
- Fall 04 exam questions
PDF, doc
- Summer 04 exam questions
PDF, doc
- Fall 03 exam questions
PDF, doc
-
PDF of Summer 03 exam questions
-
PDF of Fall 02 exam questions
-
PDF of Summer 02 exam questions
-
PDF of Spring 02 exam questions
-
PDF of Spring 01 exam questions
-
PDF of Spring 00 exam questions
-
PDF of Spring 99 exam questions
-
Analysis of Hashing
Programming Assignments
Code
-
Insertion sort code
-
Shellsort code (not covered)
-
Mergesort code (Sedgewick)
-
Bottom-up mergesort code (Sedgewick)
-
Mergesort code (CLRS)
-
Merge code (CLRS)
- Binary Search
binarySearch.c,
binarySearchRange.c
- LU decomposition
LU.c, LU.dat
- Expansion of recurrences
notes04.c
- Heap code for Notes 05
heapsort.c, intPQi.c
- Huffman coding for Notes 06
huffman.c, huffman.notes06.dat,
huffman.notes06.out, huffman.freq.c
- C code for hotel-to-airport shuttle
explicit traceback,
implicit traceback
-
C code for weighted interval scheduling
-
C code for weighted interval scheduling using powerset
-
Input case 0 (see Notes 07) for weighted interval scheduling
-
Input case 1 for weighted interval scheduling
-
Input case 2 for weighted interval scheduling
-
Input case 3 for weighted interval scheduling
-
C code for optimal matrix multiply (dynamic programming)
-
C code for longest common subsequence (dynamic programming)
- Longest Increasing Subsequence LIS.c
- Longest Strictly Increasing Subsequence LSIS.c
- Subset Sum
subsetSum.c
- Knapsack (as described in Sedgewick)
knapsackTypeRS.c
- Quicksort
qsortRS.c,
partition.c,
partitionRS.c
-
A couple of examples for using qsort()
-
Input to the examples for using qsort()
-
Selection problem using sorting or partitioning.
-
Find k largest elements using sorting or partitioning.
-
Destructive merge of linked lists C code (mergeDummy.c)
-
Circular list C code (circular.c)
- C code for free/allocated abstraction circularFree.c
- C++ code for free/allocated abstraction
circularFree.cpp,
circularFree.h,
cFtest.cpp
- Huffman coding for Notes 10
huffman2Q.c, huffman.notes06.dat
- Rat-in-a-maze
- Insert at root
-
C code and examples for red-black trees
- Linear probing, Notes 13 example, Notes 13 example
- Double hashing, Notes 13 example, Notes 13 example output
- Sedgewick depth-first search on directed graph AdjList.java,
dfs.java,
Edge.java,
Graph.java,
GraphDFS.java
- Sedgewick breadth-first search on directed graph AdjList.java,
bfs.java,
Edge.java,
EdgeQueue.java,
Graph.java,
GraphBFSedge.java
-
Depth-first search C code (directed)
- Small examples from Notes 14
dfsDir.tree.dat,
dfsDir.tree.out,
dfsDir.back.dat,
dfsDir.back.out,
dfsDir.fwd.dat,
dfsDir.fwd.out,
dfsDir.crs.dat,
dfsDir.crs.out
-
Input to depth-first search
-
PDF of diagram for input to depth-first search
-
Depth-first search C code (undirected), dfsUnd.dat, dfsUnd.out
- Kosaraju's Strong Components Using DFS (code,
input, output)
- Prim's Minimum Spanning Tree;
Example in Notes: prim.dat
Memoryless: primMemoryless.c
Table: primTable.c
Heap (C++): primHeap.cpp
(minHeap class: minHeap.h,
minHeap.cpp)
Heap (Java): primHeap.java
(minHeap class: minHeap.java,
heapEntry.java)
Sedgewick Heap: AdjList.java,
Edge.java,
Graph.java,
GraphMST.java,
MSTfile.java,
doublePQi.java
- Union-Find Trees
uf1.c,
uf2.c,
uf3.c
- Kruskal's MST: kruskal.c, kruskal.dat, kruskal.out
- Dijkstra's Shortest Path;
Example in Notes: dijkstra.dat
Memoryless: dijkstraMemoryless.c
Table: dijkstraTable.c
Heap (C++): dijkstraHeap.cpp
(minHeap class: minHeap.h,
minHeap.cpp)
Heap (Java): dijkstraHeap.java
(minHeap class: minHeap.java,
heapEntry.java)
Sedgewick Heap: AdjList.java,
Edge.java,
Graph.java,
GraphSPT.java,
SPTfile.java,
doublePQi.java
-
Warshall's algorithm C code (path recovery using successors)
-
Warshall's algorithm C code (path recovery using predecessors)
-
Warshall's algorithm C code (path recovery using transitive vertex)
-
Input to Warshall code
-
Floyd-Warshall algorithm C code
-
Input to Floyd-Warshall code
-
Ford-Fulkerson C code - adjacency matrix
-
Ford-Fulkerson C code - adjacency lists
- Network Flows (Java)
even.dat,
AdjList.java,
Edge.java,
IntQueue.java,
Network.java,
NetworkMaxFlow.java,
intPQi.java,
netflowFile.java
-
C code for KMP string search
Links
Last Updated: 4/22/20