CSC 225 Midterm exam Study Aid: Fall 2017
CSC 225 Midterm exam Study Aid: Fall 2017
The best references for this material are:
-
The class notes.
-
The free book, Chapters 1-3.
-
Assignment and lab exercises: see
the Assignments on connex.
-
Resources on connex.
-
Once we are past the mathematical preliminaries, the class text.
You are responsible for the material covered in class.
You also are responsible for all the assignment questions.
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 and worst case running times.
-
Be able to describe the best and worst case inputs.
-
Be able to analyse similar algorithms in the same manner.
-
Be able to read pseudocode or JAVA code to figure
out what it is doing.
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.
-
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
-
Trick for evaluating sum for i = 1 to n of 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
-
Determining the recurrence relations for time complexity
or a program or for counting exact numbers of certain
designated statements.
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
-
Concatenating lists
-
Reverse a list
-
Storing and manipulating big integers using linked lists.
Binary search
-
An iterative algorithm
-
A recursive algorithm
Find the maximum (4 algorithms):
-
Iterative find max
-
Begin_max
-
Middle_max
-
End_max
Sorting algorithms:
-
MaxSort
-
MergeSort
-
QuickSort
CSC 225 Home Page
/ maintained by
Wendy Myrvold /
wendym@cs.UVic.ca
/ revised Oct. 15, 2017