Programming in c++ Applied Arrays: Lists and Strings Dale/eems/Headington
1 Applied Arrays: Lists and Strings
Programming in C++ Chapter 13 Topics Meaning of a List Insertion and Deletion of List Elements Selection Sort of List Elements Insertion and Deletion using a Sorted List Binary Search in a Sorted List Order of Magnitude of a Function o Declaring and Using C Strings s Using typedef with Arrays
2 Chapter 13 Topics ❖Meaning of a List ❖Insertion and Deletion of List Elements ❖Selection Sort of List Elements ❖Insertion and Deletion using a Sorted List ❖Binary Search in a Sorted List ❖Order of Magnitude of a Function ❖Declaring and Using C Strings ❖Using typedef with Arrays
Programming in C++ What is a List? A list is a variable-length, linear collection of homogeneous elements linear means each list element(except the first) has a unique predecessor, and each element(except the last) has a unique successor
3 What is a List? ❖A list is a variable-length, linear collection of homogeneous elements. ❖linear means each list element (except the first) has a unique predecessor, and each element (except the last) has a unique successor
Programming in C++ 3 Basic Kinds of ADT Operations Constructor- creates a new instance (object) of an ADT Transformer- changes the state of one or more of the data values of an instance 8 Observer - allows us to observe the state of one or more of the data values of an instance without changing them
4 3 Basic Kinds of ADT Operations ❖Constructor -- creates a new instance (object) of an ADT ❖Transformer -- changes the state of one or more of the data values of an instance ❖Observer -- allows us to observe the state of one or more of the data values of an instance without changing them
Programming in C++ ADT List Operations Transformers Insert change state Delete Selsort Observers Is Empty IsFull observe state Length .Is Present . Print 5
5 ADT List Operations Transformers • Insert • Delete • SelSort Observers • IsEmpty • IsFull • Length • IsPresent • Print change state observe state