COSC 350: Data Structures
Feb. 16, 2009


Analysis of Algorithms Concluded

Know table of common growths—see handout

More C/C++ Constructs (and why they don't matter in Python)

Typedef and data types
Sturctures and composite data
Pointers, memory management, dynamic memory allocation
Passing parameters with argv array of argc size

Arrays

Key points about arrays (in most implementations)

Optimal for direct access of item (constant time address calculation) or for processing sequentially (i.e., index access and for-loop)
Can nest arrays (use double indexing or nested for-loops) or can have arrays of structures
In C/C++ vectors add bounds checking
Lists function as array in Python
List implementation in Python—list of addresses to objects
Examples in text: Sieve of Eratosthenes, Coin-flipping, Closest-point

Homework

For Wednesday: Complete timing assignment
For Friday: Recode the Sieve of Eratosthenes from your text (p. 85) in Python. Email it to me as an attachment. Be sure to include your name as part of the file name.

This page was created by Joe Sloan.
It was last modified on or after: 18 February 2009
Send mail to: sloanjd@wofford.edu