CSC152 2005S, Class 44: Some List ADTs Admin: * Sleep won again * For Monday: Finish the Hash table lab * Quiz! Explain the limitations of add and set * Options for continuing on in CS * About the homework: * Choose the order * Email only Overview: * What is a list? * Three kinds of lists: * Simple * Sequenced * Sorted * About list cursors Quiz * In lab on Tuesday and Wednesday, you explored add and set for java.util.Vector * (a) How are they similar? * Both methods "add" objects to the vector (change the contents) * Have similar preconditions * Can specify the place in which to add the object. * (b) How are they different? * set just replaces an element, the total size does not change * add puts it at the end (one-param) or inserts it (two-param) * If add inserts, it shifts everything down * They return different things * add returns boolean or void (nothing) * set returns an Object that represents the value that was previously in the Vector at that position [-1] * (c) What are their preconditions? * set: Must already be an element at that position 0 <= location < vec.size * add: No preconditions for adding at the end (one-parameter) * add: Location must be within bounds 0 <= location <= vec.size [-1] Other important learning goals: * You can't use an arbitrary index ... you must grow the array to the appropriate size before setting a value. /Continuing in CS/ * Recommended next course (Fall): CSC223: Software Designs * Learn a lot more Java (and re-learn the Java you've already learned) * Build a large project with fellow students * Learn about the design techniques and ideas for large projects * Recommended next course (Spring): CS201: LONG NAME * C programming * Memory management * Program verification * Alternative for the fall for people who really want to understand *computers*: CSC211 Architecture (How computers are built) * Requires special permission if you haven't taken 201 first. * Alternative for people who really love algorithm design and analysis AND have taken MAT218: Consider CSC301: Algorithms * Other interesting thing: Guided reading in "Women in Computing" (talk to Voyles or Walker for more info) * 2 credits or 4 credits * 2 credits is once per week * Digital Art! Limit of 12 * Prospective CS majors should also take more math in the fall MAT131 Calc I : Differential Calculus MAT133 Calc II : Integral Calculus MAT215 Linear Algebra: Important if you ever want to do real computer graphics * There may be a computer-based version MAT218 Combinatorics: Mathematics of combinations