List
is informally
defined below. Give a more formal description similar to those given
in the handout on Data
Abstraction. That is, give the sets involved and the signatures
and semantics of the operations. (You may, if you wish, state the
signatures and semantics together as I did for the Day
ADT in the handout.) Divide the operations into constructors,
mutators, accessors, and destructors.
List
abstract data type as a
set of subprograms. Since you are to implement an abstract data
type, not just a single abstract data structure,
your package should allow the creation of multiple instances of the
List
type. If you use C++ or another object-oriented
language, do not use the class
construct; the purpose of
this task is to review techniques for implementing ADTs in traditional
imperative languages.
Issues to consider: What is the nature of the "items" to be stored in the list? (For example, can you create lists of integers, lists of records, etc.?) How do you represent the list internally (e.g., as an array, a dynamically allocated linked list structure, etc.)? How can you dynamically create, use, and destroy multiple instances of the list ADT? Do your mutators change the instance's state or do they create modified copies?
Test and document your package carefully. The subprograms that make
up the List
package should be clearly noted and
separated from the framework needed to test the package.
Please submit a paper listing of your source code. Also submit a listing showing your testing of the package.
List
The ADT List
represents lists (or sequences) of items.
List
includes the following operations:
createList
destroyList
prepend
append
head
decapitate
length
isEmptyList
isFullList
concat
UP to CSci 581 Assignments page?