CS313E Study Guide: Fall 2011
This is study guide for the CS313E midterm and final. The best
strategy to study is to read over the slides and make sure that you
understand the code you've written. You can bring one handwritten 8
1/2 by 11 sheet of notes to the test; you can use both sides of the
sheet.
Slideset 1: Introduction
- Understand basically what a computer is, what the major
components are, and how the fetch-execute cycle works.
- Understand conceptually how different types of information are
represented in a computer.
Slideset 2: Basic Python
- You are expected to have facility with basic Python language
constructs and be able to write simple programs.
- Understand the basic design goals of Python.
- Know how to run Python programs.
- Understand the primitive Python data types: integers, floats, bools.
- Understand how variables work in Python.
- Understand the complex data types: strings, lists, and
dictionaries.
- Know how to use the arithmetic and relational operators.
- Understand how to use Python conditionals and loops.
- Know how to write and call Python functions.
- Know the difference between mutable and immutable data
structures.
- Understand how to use the function input.
Slideset 3: Turtle Graphics
- Understand how the turtles exemplify object oriented programming.
- Understand a turtle's state.
- Be able to write simple turtle programs.
- Understand the scheme for specifying colors (RGB).
Slideset 4: Classes
- Understand what a class is.
- Know how to write simple classes.
- Understand what attributes and methods mean wrt classes.
- Understand accessors and mutators.
- Understand the "magic methods" like __str__, __len__, __init__, etc.
Slideset 5: Abstract Data Types
- Understand what an abstract data type is and how they're used.
- Be able to explain why encapsulation is important.
- Understand how ADTs are implemented as classes in Python.
- Know the details of the Stack class and how to use it.
- Understand at an intuitive level the Stack algorithms
we discussed. You don't need to be able to write them from scratch.
- Understand Python's dictionary type and how it's used.
Slideset 6: Queues
- Know the details of the Queue class and how to use it.
- Understand the market simulation example.
- Understand inheritance (single and multiple), what it means, and
how it's done in Python.
- Understand the Rectangle/Square example and how it works.
- Understand when methods are new, inherited or overridden in a
class.
- Understand bounded queues and priority queues and how they are
implemented in Python.
- Understand bounded priority queues and how they are implemented
via double inheritance.
Slideset 7: Linked Lists
- Know how to use the Python list type.
- Understand the List ADT interface.
- Understand the two ways to implement lists, contiguous and linked
implementation.
- Understand when a method is constant-time and when linear-time.
- Understand the Node and Unordered List classes.
The following came after the midterm.
Slideset 8: Recursion
- Understand what recursion is.
- Understand what must be true of recursive routines.
- Be able to write simple recursive routines.
- Understand the overhead of recursion.
Slideset 9: Efficiency
- Understand the concept of algorithm efficiency.
- Understand the Big-O concept.
- Be able to explain the difference between best, average and worst
case efficiency.
- Know why worst case is often chosen.
- Be able to estimate the efficiency of simple code fragments,
particularly nested loops.
- Understand the categories: constant, logarithmic, linear,
quadratic, and exponential.
Slideset 10: Trees
- Understand the vocabulary associated with the Tree ADT.
- Understand expression trees.
- Know the BinaryTree and TreeNode interfaces.
- Understand the implementation in Python of BinaryTrees.
- Understand the notion of BinaryTree as a "wrapper" on nodes.
- Understand the algorithm for converting a postfix expression to a
BinaryTree.
- Understand the four tree traversals: postorder, inorder, preorder
and level-order.
- Know that all of the traversals are linear time.
- Understand the algorithm for evaluating an expression tree.
- Understand binary search trees and their interface.
- Understand why balancing a tree may be necessary.
- Understand the TreeSort algorithm and its complexity.
Slideset 11: Language Interpreter
- Be able to read and understand code.
- Understand basic object oriented design.
- Know the Python constructs used in this application such as split
and strip.