DATA STRUCTURES: INTRODUCTION ============================= What makes a program good? (1) it works (2) it is easy to understand/modify (3) it is reasonably efficient To help achieve (2) (which helps w/(1)) use abstraction / modularity / information hiding e.g.: Abstract Datatypes (ADTs) Idea: separate conceptual objects and operations from actual implementation Benefits: . program is easier to understand (easier to see "high-level" steps being performed, not obscured by low-level code) . implementations of ADTs can be changed (e.g., for efficiency) w/o requiring changes to program . ADTs can be reused in future programs Two parts to each ADT: 1. public or external part: a. conceptual picture (user's view of what the object looks like, how the structure is organized) b. operations (what the user can do to the ADT) 2. private or internal part a. representation (how the structure is actually stored) b. implementation of operations (actual algorithms used) Note: there are many possible operations they often fall into these categories: (1) initialize (2) add data (3) access data (4) remove data (5) destroy -- especially when using language like C/C++ that requires explicit memory management