CSE 116 Lecture Notes - Lecture 6: Multiset, Quinoa
Document Summary
Abstract state what is done, not how it is done. Data access and use collections of data. Type used to organize and define data usage implementation: adts must remain abstract any implementation okay, if it completes methods, could implement an adt with: Collection interface: java interface used by all adts specifies base methods to be implemented by classes these methods define rules for how data is organized usage depends on adt"s specification of method. Clicker question: array is an adt: true, false answer: b. Not possible with multiset using these methods: calling methods to get listing of set"s elements, ordering elements within set for later processing. String b = bob ; ms. add(b); ms. add(b); ms. add( bob ); assertequals(______, ms. size()): 0, 1, 2, 3, 4 answer: d. 3. Methods must work, but can they use any storage: arraylist, almost always use an array.