CSC152 2004F, Class 52: Implementing Lists with Arrays Admin: * Comments for groups * Questions on the exam? * No homework for Monday. Overview: * SimpleList and SimpleCursor ADTs * Using arrays to implement simple lists /Comments for Groups/ * Don't make fun of each other * UI needs to let you say more than one word * It is now possible to eat pizza! * Who is responsible for the broadcaster? * (a) UI * (b) Server * (c) Anyhing that attaches to the world /Exam: Questions?/ * I rely on some files that aren't in the exam3 directory. You should not copy those files. You can find them in the "normal" way. /Review: Simple Lists, Simple Cursors, and such/ * List: A DYNAMIC (extensible) non-indexed bunch of values THAT YOU CAN ITERATE * In programming terms, what does iterate mean? * In general programming terms: There is some sequence of function calls you can make to get all the values in the list (w/o using an index) * In our particular example SimpleCursor sc = sl.getCursor(); while (sc.hasNext()) sc.next(); * Three key simple list operations: * add(Object addMe) * remove(SimpleCursor where) * getCursor() * See SimpleList.java and SimpleCursor.java /DS: Implementing Lists/ * ADT: Philosophy, Application, Methods, *Implementation* * DS: Philosophy, Method Details, Running Time * Philosophy one: Implement lists with arrays * Although arrays have indices, we do not reveal them to the client * Keep track of how many values are "in" the array. * Method sketches * Add the next value at the end of the filled portion. * Iterators keep an index /Exam Questions?/