




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















0 1 1 12 2 2 3 3 3 19 4 4 100 5 5 75 6 6 10 …?? … maxItems maxItems ? itemCount ? ADT list positions Array indices items
/** ADT list: Array-based implementation @file ArrayList.h */ #ifndef ARRAY_LIST_ #define ARRAY_LIST_ #include “ListInterface.h” #include “PrecondViolatedExcept.h” template < class ItemType> class ArrayList : public ListInterface
template < class ItemType> ItemType ArrayList
template < class ItemType> bool ArrayList
template < class ItemType> ItemType ArrayList
template < class ItemType> ItemType ArrayList
Shifting items to remove
template < class ItemType> void ArrayList
item next
item next
item next
item next
headPtr itemCount 4
/** ADT list: Linked-based implementation @file LinkedList.h / #ifndef LINKED_LIST_ #define LINKED_LIST_ #include “ListInterface.h” #include “Node.h” #include “PrecondViolatedExcept.h” template < class ItemType> class LinkedList : public ListInterface
template < class ItemType> ItemType LinkedList
template < class ItemType> ItemType LinkedList