CS 2223 Dec 15 2015
Expected reading:
Daily Exercise:
"The time has come,"
the Walrus said, "To talk of many things:
Of shoes–and ships–
and sealing-wax–
Of cabbages–and kings–
And why the sea is boiling hot–
And whether pigs have wings."
Lewis Carroll
1 Final Preparations
1.1 Quiz 3
First let’s take care of quiz 3
1.2 Review
1.2.1 Data Structures
You are assumed to know the following basic structures:
Arrays
Linked Lists
You know when you should use these structures, and the implication of accessing aggregate data when stored in these structures.
You know about access performance in unordered arrays and linked lists.
1.2.2 Types
You should be well-versed in the basic data types used in this course. This includes:
Bag
Stack
Queue
Priority Queue with Heap
Binary Search Tree
Balanced Binary Search Tree
Chained Symbol Table
Indexed Priority Queue with Heap Supporting DecreaseKey
Undirected Graph
Directed Graph
Directed Weighted Graph
These types all have common operations as well as specific ones. For example, priority queue and binary search tree both support a deleteMin operation.
Sample Question: How does a Min Priority Queue support
decreaseKey operation?
And why is it hard to envision
adding an increaseKey operations?
Sample Question: In Java it is not possible to resize an array of size N; rather you must create a new one (with a size > N) and manually copy the N element into the new array. With this in mind, how is it possible that an array-based implementation of Stack can still guarantee O(1) constant performance on the push operation?
Sample Question: You are given a connected undirected graph with an even number of vertices, V, and an even number of edges, E. This graph can be split into two graphs G1 and G2, each of which contains half of the vertices and have of the edges from the original graph. True or false? If false, provide counter example. If true, explain your reasoning.
Sample Question: You are given an AVL tree that contains 15 unique values. Compute the maximum height of the tree, that is the greatest distance from any leaf node to the root, that still guarantees the AVL property.
1.3 Performance classifications
We finally introduced the Big O notation as a means to classify the order of growth of an algorithm. This provided the finishing touches on the performnance analysis that we conducted throughout the term.
You should be able to reflect on the performance families we have seen:
O(1) constant
O(log N) logarithmic
O(N) linear
O(N log N) linearithmic
O(N2) squared
O(N3) cubic
O(Nk) polynomial
O(kN) exponential
Sample Question: You are given a recurrence equation T(n) that is used to estimate the running time performance of an algorithm. You are told that T(N) = 2*T(N/3) + N/3. What is the overall classification using the above families of T(N)?
1.4 Algorithm Families
We discussed a number of thematically related algorithms:
Sorting arrays of unordered elements
Searching for values in collections
Exploring Graph structures to validate properties
Computing shortest path over weighted graphs
Given a undirected, connected graph, generate a subset graph H that (a) is connected; (b) contains the same vertices; and (c) contains a subset of the edges of G. What is the running time/performance of your algorithm?
1.5 Course Evaluations
I will be handing out the course evaluations at the end of class today, say final ten minutes.
1.6 Version : 2015/12/15
(c) 2015, George Heineman