1 Final Preparations
1.1 Data Structures
1.2 Types
1.3 Performance classifications
1.4 Algorithm Families
1.5 Course Evaluations
1.6 Version : 2018/ 04/ 22

CS 2223 Apr 30 2018

Lecture Path: 27
Back Next

Expected reading:
Daily Exercise:
Classical selection: Beethoven: Symphony No. 9 (1824)
Musical Selection: Train: Drops of Jupiter (2001)

"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 Data Structures

You are assumed to know the following basic structures:

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.

Sample Question: You can locate the maximum value in an array of N elements in N-1 comparisons. Now assume you want to find the smallest and the largest value in the same array. What is the lower bound on the number of comparisons you need to make (i.e., the best case)? What is the upper bound on the number of comparisons you need to make (i.e., the worst case)? Can you provide sample instance problems with four elements to cover both these cases?

With linked lists, we saw how they were useful for storing loosely structured collections of values. They are used to implement Bag types, when there is no need to search through, but only retrieve all values in the Bag.

You have seen linked lists as they effectively implement a queue by maintaining two separate pointers, first and last.

Sample Question: Explain how to use a linked list to implement the stack data type.

1.2 Types

You should be well-versed in the basic data types used in this course. This includes:

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: 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.

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:

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:

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 : 2018/04/22

(c) 2018, George Heineman