A linked list can be defined as either
- The empty list (NULL)
- A node consisting of an element and a pointer to the next list.
The front of a list is commonly called its head, and the rest of the list is commonly called its tail (think of tadpoles, not dogs):
class Item { public: Item(); bool equals(Item& other); private: // hidden }; struct ListNode { Item element; ListNode * next; }; typedef ListNode * List; // C-style ADT definition List createList(); void deleteList(List *list); int isEmpty(List list); int length(List list); void insertListItem(List *list, Item item, int position); void removeListItem(List *list, Item item); Item getItemAt(int position); How would you define 7 operations given above?