Home IDS 401

Notes Index

 

Charles E. Oyibo


3: ADTs Unsorted List and Sorted List

Lists

ADT Unsorted List

Unsorted List ADT Specification

Definitions (provided by user)

maxItems an integer specifying the maximum number of items to be on the list

Operations (provided by Unsorted List ADT)

void UnsortedStringList(int maxItems)

instantiates this list with capacity of maxItems and initializes this list to empty state

Precondition

Postcondition

 

void UnsortedStringList() instantiates this list with capacity of 100and initializes this list to empty state

Precondition

Postcondition

 

boolean isFull() determines whether this list if full

Precondition

Postcondition

 

int lenghtIs() determines the number of elements on this list

Precondition

Postcondition

 

boolean isThere(String item) determines whether item is on this list

Precondition

Postcondition

 

void insert(String item) Adds copy of item to this list

Precondition

Postcondition

 

void delete(String item) Deletes the element of this list whose key matches item's key

Precondition

Postcondition

 

void reset() initializes current positio for an iteration through this list

Precondition

Postcondition

 

String getNextItem() returns a copy of the element at the current position on this list and advances the value of the current position

Precondition

Postcondition

 

* current position is a property of the list

 

Abstract Classes: Relationship between Unsorted and Sorted Lists

ADT Sorted List

Common Orders of Magnitude

Generic ADTs

Top of Page

Charles E. Oyibo
IDS :: CBA :: UIC