50 likes | 396 Views
Abstract Data Type (ADT). A set of objects. A set of operations over the set of objects. Some operations have “side effects”: they change the behavior of subsequent operations. A data structure is an ADT for which some aspect of operation performance relating to time or space is known.
E N D
Abstract Data Type (ADT) • A set of objects. • A set of operations over the set of objects. • Some operations have “side effects”: they change thebehavior of subsequent operations. • A data structure is an ADT for which some aspect ofoperation performance relating to time or space is known.
Communicating Performance Issues • Reading assignment: Chapter 2 of course text. • Need to understand: • T(N) “is order” f(N) (written T(N) = O(f(N))) • T(N) “is omega” f(N) (written T(N) = (g(N))) • T(N) “is theta” f(N) (written T(N) = (h(N)))
c2 f(N) T(N) T(N) = O(f(N)) (there exists c1 and c2 s.t. for all N > c1: c2 f(N) T(N)) c1 T(N) c2 g(N) T(N) = (g(N)) (there exists c1 and c2 s.t. for all N > c1: c2 g(N) T(N)) c1
Other Performance Issues • Reliability. • Ease of maintenance. • Portability. • …
First Assignment Issues What do we mean by iterator protocol or by iterator design pattern? To print “names and ages of all students in CS334”: var Eit: CMEnrollmentITER; … begin ... if CMFirstEnrollment(‘CS334’, Eit) then repeat write(Eit.StudentName); write(Eit.StudentAge); until not CMNextEnrollment(Eit); … end