CSC 225 Final exam Study Aid: Fall 2013
CSC 225 Final exam Study Aid: Fall 2013
You are responsible for the material covered in class.
You also are responsible for all the assignment questions.
This will be updated closer to the time of the final exam.
The course curriculum for CSC 225 has been changed since the
last time I taught this class. As a result, some of the old
final exam questions may no longer be relevant.
For all algorithms in this class, you should be able to:
-
Give a high-level description of the algorithm.
-
Be able to convert the high-level description into more
detailed pseudo-code
(similar to JAVA or C but syntax is not important).
-
Create a correct JAVA program.
-
Use Big Oh and Omega notation to analyse
the best, worst and sometimes average running times
and space requirements.
-
Be able to describe the best and worst case inputs.
-
Be able to analyse similar algorithms in the same manner.
-
Be able to read psuedocode or JAVA code to figure
out what it is doing.
-
Analyse the space complexity.
Lower bounds
For the comparison model, some lower bounds are
-
Omega(n log 2 n) for any sorting algorithm
-
n-1 key comparisons to find the max of n data items
Definitions
-
The comparison model
-
The sorting problem
-
Optimal
-
Big Oh, Omega, Theta
-
Worst, best and average cases
-
Maximum element of an array
-
Loop invariant
-
Complete binary tree, height of a rooted tree
Mathematical Concepts
-
Log, floor and ceiling functions.
-
Partial orders and Hasse diagrams
-
Finding upper and lower bounds by under and over estimating
each term in a sum
-
Proving Big Oh relationships
-
Trick for evaluating sum for i = 0 to n of 2 i
-
Formulas for complete binary trees
-
Understand iteration and recursion
-
Inductive definitions
-
Induction for formulas and also to reason about programs
-
Proving loop invariants
-
Solving recurrences by repeated substitution
Some of the algorithms we have analysed are:
Linked list algorithms:
Make sure you can draw pictures to step through
the operations of code that manipulates linked lists.
Also, you should be able to do new things using lists
(iteratively and recursively).
-
Add to front
-
Add to rear with a rear pointer
-
Two algorithms for concatenating lists (one O(1) and the other O(n)
-
Delete from a list given a previous pointer O(1)
-
Reverse a list.
Find the maximum (4 algorithms):
-
Iterative find max
-
Begin_max
-
Middle_max
-
End_max
Sorting algorithms:
-
Four sorting algorithms based on these 4 algorithms for finding the max.
-
Mergesort
-
Quicksort
-
Radix sort
-
Max sort
-
Heapsort
Heaps:
-
Two algorithms for builing a heap- O(n) and O(nlogn)
-
Bubble up and bubble down in heaps
-
Heapsort
-
Array storage which avoids use of pointers.
Binary search trees:
-
Insert
-
Traverse in preorder, post order, in order
-
Binary tree sort: insert the keys then traverse in order.
Graphs:
-
Traverse using adjacency matrix/adjacency list for BFS and DFS.
-
Add edge
-
Check is an edge is present
-
Stacks and Queues in arrays (mentioned during BFS/DFS)
-
Hashing:
-
Open addressing
-
Closed addressing
Minimum Weight Spanning Trees
-
Kruskal's algorithm (the greedy approach that first
sorts the edges by weight and then adds edges in order
if they do not make a cycle with the edges already
in the tree).
-
The union/find data structure for connected components.
Some material now in CSC 226
The curriculum has changed for CSC 225.
The following algorithms appear on old final exams
will not be on your final exam.
-
The Dijkstra/Prim algorithm for minimum weight spanning trees.
-
Boruvka's algorithm for minimum weight spanning trees.
-
Shortest Path problem
CSC 225 Home Page
/ maintained by
Wendy Myrvold /
wendym@cs.UVic.ca
/ revised Nov. 20, 2017